[Greasemonkey] Javascript character encoding problem
Anton Berezin
tobez at tobez.org
Wed Apr 5 16:10:58 EDT 2006
On Wed, Apr 05, 2006 at 12:39:58PM +0200, Jonas Lundberg wrote:
> Thank you. The encodeURI suggestion would work, which I am quite happy
> about. However, then I would have to un-encode it on the server side
> as well, which adds processing and a source for errors.
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.
> 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.
\Anton.
--
An undefined problem has an infinite number of solutions.
-- Robert A. Humphrey
More information about the Greasemonkey
mailing list