Page encoding & XMLHttpRequest
- View SourceHello,
First, I apologize if this is a bit off-topic, but I hope someone can help.
I'm having a problem with passing non-ASCII parameters using XMLHttpRequest. The encoding of the page where the request is made is windows-1256, however, parameters are encoded differently when sent to the server using XMLHttpRequest. I've tried using escape() & encodeURIComponent() on the parameters before adding them to the URL, but it didn't help. escape() returns a unicode string, while encodeURIComponent() uses some other multibyte encoding.
Instead of using XMLHttpRequest, I tried submitting the parameters using a form on the same page, and they were indeed sent in the page encoding (windows-1256). It seems that XMLHttpRequest has to be instructed to do something (or may be not do?) when sending the parameters, but I wasn't able to find anything relevant in its methods so far...
Mahmoud Al Gammal
This message was sent from a MailNull anti-spam account. You can get
your free account and take control over your email by visiting the