[Greasemonkey] Javascript character encoding problem

Lenny Domnitser ldrhcp at gmail.com
Wed Apr 5 22:23:32 EDT 2006


On 4/5/06, Jonas Lundberg <my.name.is.hans at gmail.com> wrote:
> That's possible, but I am trying to send some Swedish characters, the
> A and o with a ring and dots( å and ä and ö, also Å Ä Ö). If I submit
> these using a traditional submit button, then they are send as they
> are. If I use GM_xmlhttpreques, then OTHER characters are sent. These
> other characters might be UTF-8, but my problem is that they are
> DIFFERENT from the ones that were in my form.
> Maybe, I am doing something wrong here?

Try appending a charset parameter to your Content-Type header. Untested remedy:

Replace
    headers: { 'Content-type': 'multipart/form-data; boundary=shapecms' }
with
    headers: { 'Content-type': 'multipart/form-data;
boundary=shapecms; charset=utf-8' }


More information about the Greasemonkey mailing list