www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to force plugin charset/encoding?

  1. #1
    Join Date
    Dec 2012
    Posts
    2

    Question 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:
    Code:
    document.getElementsByTagName("html")[0].setAttribute("lang", "es");
    Then, I wrote a "converter function" which replaces the special characters with unicode, like the next line, bub it didn't work.
    Code:
    str.replace( /ú/g, "/xfa־" );
    What can I do?

  2. #2
    Join Date
    Aug 2008
    Location
    Sweden
    Posts
    227
    Have you tried using UTF-8 as the charset on your page?
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  3. #3
    Join Date
    Dec 2012
    Posts
    2

    Yes, but...

    Yes, but the problem is not the page (it have utf8). The problem are elements added by the script.

  4. #4
    Join Date
    Aug 2008
    Location
    Sweden
    Posts
    227
    Make sure the data the server sends is in the correct charset. (I don't quite remember, but saving the JavaScript files in UTF-8 might be enough, if you haven't done that already.)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles