0

I use ajax to read a parameter and display it in my HTML.

  • in my UTF8 HTML I see ���� ��� [4- X "black diamond with question marks" 1-space 3 X "black diamond with question marks"]
  • in firebug | Script | Watch, I see the same "���� ���" [4black-diamonds space 3 blackDiamonds]
  • in firebug | Net | Response\Json, I see "ùìåí àáâ" [recommended tool in Why does a diamond with a questionmark in it � appear in my HTML?

How do I use javascript to translate "ùìåí àáâ" into the Hebrew string "שלום אבג"

What encoding does it use?

Community
  • 1
  • 1
Atara
  • 3,523
  • 6
  • 37
  • 56
  • 1
    you don't need JS for this, it is most likely an encoding problem. Check that the file is processed as UTF-8 from the saving to the browser. Then you can simply paste the hebrew chars in the file. – Thomas Jun 06 '16 at 14:35
  • The HTMl file is saved as UTF8 and uses UTF8 meta encoding. yet it does not mange to show these ajax characters – Atara Jun 07 '16 at 07:52
  • can you link the page? maybe it shows the error. Because, as long as all parties agree about the encoding of the data, everything works fine ([see here](//jsfiddle.net/b3qar0gz)). So at some point between the file and the browser someone seems to parse/interpret that as not-utf8 data – Thomas Jun 07 '16 at 16:25
  • I cannot show the page. I get the data from CGI, using Ajax. I am not sure yet what encoding this CGI+Ajax uses. I will ry to use js encodeURI() to debug the text I get . . . – Atara Jun 08 '16 at 08:36
  • Go to the network-panel of your browsers dev-tools there you can see all requests, including headers and stuff. – Thomas Jun 08 '16 at 10:27
  • Thanks for your support. I did not manage to get in my code the same values I see in Firebug - http://stackoverflow.com/questions/37700122/imitating-firebug-net-tab – Atara Jun 08 '16 at 10:38

0 Answers0