开发者

working with none english text in firefox extension (addon)

This is the code that I have in javascript file inside my addon:

 function ShotText() {
      var inputString = "שלום"; //Hebrew letters
      alert(inputString);             
}

When I run this function using addon I get this:

alt text http://img693.imageshack.us/img693/8782/shalom2.jpg

But if I run the same code w开发者_运维知识库ithout addon (regular javascript function), I get this:

alt text http://img693.imageshack.us/img693/5236/shalom1.jpg

Where is the problem?

Maybe I need to set encoding somewhere inside the extension?


https://developer.mozilla.org/En/International_characters_in_XUL_JavaScript explains the behavior in detail. Note that this is a wrong thing to do anyway, since the user-visible strings should be in the extension's locale, so that the extension could be translated to other languages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜