international characters in Javascript

后端 未结 6 1349
有刺的猬
有刺的猬 2020-12-15 08:12

I am working on a web application, where I transfer data from the server to the browser in XML.

Since I\'m danish, I quickly run into problems with the characters

6条回答
  •  盖世英雄少女心
    2020-12-15 08:55

    If you ever can't set the response encoding, you can use \u escape sequence in the JavaScript string literal to display these characters.

    alert("\u00e6\u00f8\u00e5")
    

提交回复
热议问题