I am trying to write a firefox addon and just met this problem.
Firefox seems to encode the search engine URL using the encoding of the website, suppose we have the word "", which means the fire is in Chinese, and we search for it using google, the URL
http:
This url is decoded / not tied to UTF8, but if I go to Baidu, the Chinese search engine whose encoding is gb2312, we get the url
http://www.baidu.com/s?wd=%BB%F0
Here BBF0 is gb2312 code for '火',
How can I get a UTF8 character from some encoding (gbk, jp or something else) with firefox API? I went through the nsIScriptableUnicodeConverter part on develop.mozilla.org and just can't find a suitable way to do this.