Welcome Guest, Not a member yet? Register   Sign In
character encoding
#1

[eluser]Ñuño Martínez[/eluser]
Hello.

This is not CodeIgniter related topic but I think somebody can help.

We're working in a web application and we're having problems with character encoding. The server is Apache+PHP5+MySQL in a Debian (with CodeIgniter installed, of course Wink). I'm using a Xubuntu with everything (including editors) configured to use UTF-8 as default, the other developer is using Windows (AFAIK ISO-8859-1) and we have a SVN system on the Debian server. CodeIgniter was initially configured to set the UTF-8 encoding in headers as well.

When we start testing we had a first problem with JavaScript. JS doesn't understand about &html; entities so here start the problems (we're Spanish and characters as "áéíóúñ..." are quite common) because the "alert" function doesn't show the correct characters on Windows systems. We have also problems with the database because it stored the data using UTF-8 but Apache sends the responses as it where ISO-8859-1 making it unreadable.

Then we decide to change the codification of all PHP and JS sources to ISO-8859-1 and reconfigure CodeIgniter to put it in the headers just because it seems like that is the codification used by Apache to send the data. Now the behavior is more bizarre. Sometimes it shows the text correctly, sometimes shows the same text bad and I can't see why. It seems arbitrary. :-S By the way I've check the request headers and they're using always UTF-8 (even in Windows IE :ohh: ) despite the encoding I requested or the one used by the web page, the client OS or the browser.

The guy who manages the server tells me everything is correctly configured but I'm not sure at all and I can't check it (I have no idea about how to configure a server or a database. I tried to learn it but I think it's beyond my capabilities :red: ).

I have no idea what we're doing wrong. Is it CodeIgniter's fault? Is it XMLHttpRequest object's fault? Is it Apache's fault? What should I check? What should we change? I'm confused...
#2

[eluser]Unknown[/eluser]
Hi there,
I have same problem, but with ISO-8859-2. Sometimes everything is displayed good, and sometimes is see ?????. Any suggestions to resolve problem? Something? Any clues what should I check?
#3

[eluser]Ñuño Martínez[/eluser]
I suggested the same (to use only UTF-8) but we have problems with the MySQL server. We try to fix the server but we did something wrong because it stored some registers using UTF-8, some other using latin1_swedish_ci (?).

By the way I'm trying to understand how to modify the headers in a XMLHttpRequest object to change the "encoding" but it always use UTF-8. Even I tried with a wrapper (MooTools).
#4

[eluser]Ñuño Martínez[/eluser]
I see.

BTW, I was playing with XMLHttpRequest and I've found that if I use the header "application/x-www-form-urlencoded; charset=utf-8" Firebug tells that data was send using "utf-8", but if I use the header "application/x-www-form-urlencoded; charset=iso-8859-1" then Firebug tells that data was send using "UTF-8" (note the upper/lower-cases).

I'm a bit confused. :-S




Theme © iAndrew 2016 - Forum software by © MyBB