Have you tried:
new Ajax.Request('someUrl', {
onCreate: function(resp) {
resp.transport.overrideMimeType("text/html; charset=ISO-8859-1");
}
})
On Feb 9, 3:46 am, veilure <[EMAIL PROTECTED]> wrote:
> Howdy,
>
> For my site I'm using ISO-8859-1 encoding. The whole site is based on
> it, so is the mysql database. Changing it to UTF-8 really isn't an
> option at this point.
>
> The problem is that when using the XMLHttpRequest, the responseText
> always comes back as UTF-8. I set the encoding in Prototype.js to
> ISO-8859-1, but from what I could find this doesn't change anything
> for the XMLHttpRequest method. Inserting this output into the
> database, makes special characters unreadable, because everything on
> the site is based on ISO-8859-1, not UTF-8.
>
> So, I've been looking for days to get a respons in the right encoding,
> without much success. At this point, I use utf8_decode() in php to
> decode all text variables before inserting them into the database.
> This solves the problem partly, but many characters still aren't
> decoded properly.
>
> Today I found this
> website:http://squio.nl/blog/2006/06/27/xmlhttprequest-and-character-encoding/
>
> It talks about 'overrideMimeType' and how this should be able to let
> me output everything in ISO-8859-1 instead of UTF-8. I've been looking
> through Prototype.js and trying to implement this, but so far without
> any luck.
>
> Does anyone have a solid solution for changing the encoding on the
> responsText from the XMLHttpRequest? Or does anyone know how to
> implement this overrideMimeType in Prototype? I'd really like to keep
> using Prototype, but without proper ISO-8859-1 encoding, it's going to
> be a problem...
>
> Thanks in advance for any hints you can give me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---