views:

36

answers:

2

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

But if I run the same code without addon (regular javascript function), I get this:
alt text

Where is the problem?

Maybe I need to set encoding somewhere inside the extension?

A: 

What I needed to do was saving the file in UTF-8 format...

ronik
You should accept Nickolay's answer since that tells you the issue.
sdwilsh
+2  A: 

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.

Nickolay