[Greasemonkey] Javascript character encoding problem

Jonas Lundberg my.name.is.hans at gmail.com
Wed Apr 5 17:08:17 EDT 2006


Thank's for the input!

> Actually this is not so.  Provided that the backend expects UTF-8 - and
> I would like to hear about any reasons why it should not - and uses any
> minimally competent CGI library, no decoding is necessary by nature of
> application/x-www-form-urlencoded content type.

I program the back-end in xQuery so I guess that the back-end
competence bounces right back at me... I use multipart/form-data,
since that will allow me to send images as well.

> > The encoding headers seems to be identical in my two cases. It thus
> > looks like that it is Javascript that serializes strings with
> > international characters incorrectly.
> Hmm.  You are clearly getting UTF-8 in your GM_xmlhttpRequest() call,
> and that is actually a more correct behavior in comparison to most
> anything else, unless you would argue that international characters are
> limited by 8869-1[5] charset.

If I indeed get UTF-8 in my call, then I would prefer to get the
correct UTF-8 characters in it. Since the alert(); mehtod works, I
would guess that there is a bug in GM_xmlhttpRequest(). Is that
possible? In the string, I have tried using the characters as they
are, or an escape sequence, like \u00e5\u00e4\u00f6\u00c5\u00c4\u00d6.
Nothing works.

Regards
Hans


More information about the Greasemonkey mailing list