Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
12-07-2012, 05:49 PM #1
- Join Date
- Dec 2012
- Thanked 0 Times in 0 Posts
How to force plugin charset/encoding?
Hi! I'm having a trouble with my mobile plugin: it shows me the new elements added by scripting with a different charset of the page. E.g. I can read "cuadrúpedo" but the same word in my plugin show "cuadrÂ¡pedo".
I tryed writing the next line to the beginning of my plugin, but it didn't work:
str.replace( /ú/g, "/xfa־" );
12-08-2012, 04:10 PM #2
- Join Date
- Apr 2011
- London, England
- Thanked 354 Times in 353 Posts
document.getElementsByTagName() is available only when the page (or possibly part of it) has been loaded/rendered. Although I know very little about using other languages it seems logical to me that it is too late to change the language of the page(?) once it has been rendered.
The character encoding may also be required:
although I suspect this is the default.Code:<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
If you are only adding a section of the page then you could add lang="es" to, for example, a DIV and then insert the content into this div.