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.jpgBut if I run the same code w开发者_运维知识库ithout addon (regular javascript function), I get this:
alt text http://img693.imageshack.us/img693/5236/shalom1.jpgWhere 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.
精彩评论