![]() |
|
Problems with character encoding in a new istall of Zen Photo - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Problems with character encoding in a new istall of Zen Photo (/thread-2921.html) |
Problems with character encoding in a new istall of Zen Photo - optimiced - 2008-05-20 Hi, A while ago I've reported a bug and suggested a fix: I just installed Zen Photo successfully, for the first time on a server. Because it's a first-time install, I've set this in zp-config.php: This should make so that everywhere all data is encoded as UTF-8, right? But somehow, characters are not encoded as they should:-( OK, report:
If I change the character encoding in my browser to Windows-1251, in the MySQL database characters start to look OK and readable (for example, the questionmarks you see, become: "ТеÑтов Ðлбум"). What's the reason for that? Isn't 'SET NAMES' properly working? Any other ideas?... What should I test?
Problems with character encoding in a new istall of Zen Photo - optimiced - 2008-05-20 ? :-( Problems with character encoding in a new istall of Zen Photo - acrylian - 2008-05-20 Sorry, I have currently no idea. Problems with character encoding in a new istall of Zen Photo - optimiced - 2008-05-21 @acrylian: OK, I've done some more testing: I installed a new copy of Zen on another hosting, just for test purposes. Set In front-end and in the MySQL database all is OK, all characters are normally readable. Now, where should I look for the problem, then? If I see Is it possible that some other server configuration is interfering with it? I always thought that SET NAMES if specified in the application (right around the code where the connection to the database happens) is having the top priority and the encoding should be as defined there, even if globally on the server the default MySQL encoding is latin-1 or some other?... Or am I wrong? I'm just looking for clues, as currently I can't use the Zen when MySQL data is unreadble... (well, front end is OK, but having '???????' in the database will lead to trouble one day or the other...) Problems with character encoding in a new istall of Zen Photo - acrylian - 2008-05-21 I am sorry, I am sadly neither a MySQL expert nor a server expert and this encoding stuff is one of the most difficult stuff I think. Maybe you could post your server data (version number etc plus MySQL and PHP versionnumbers)? Maybe another developer (trisweb probably) or user has any idea. Problems with character encoding in a new istall of Zen Photo - optimiced - 2008-05-21 I do not think that PHP & MySQL versions are so important, but I'll send the numbers, anyway The only guess I can make is that the MySQL database tries to use another encoding and ignores (possibly) the SET NAMES command specified by Zen -- so what happens is that UTF-8 data is encoded in the wrong encoding -- and while on the front-end all looks OK, on the back end - in the MySSQL - data becomes unreadble in UTF-8; but why's that, I cannot tell... --M. PS Here be some data: Problems with character encoding in a new istall of Zen Photo - trisweb - 2008-05-22 I believe the reason you can't see the UTF-8 correctly in the database is that we use a simpler encoding for storing the database strings, and then convert it to the expected character set when it's rendered. So, as long as everything is working OK in the front end, I would not worry about it. Of course it would be best if everything was encoded UTF-8, and I think that's how it should be, I will take a look at the encoding sequence and see if I can find any issues. Please create a trac ticket if you're experiencing any problems due to this. Thanks! Problems with character encoding in a new istall of Zen Photo - vidisad - 2008-05-22 I got the same broblem but at the front end. I did not check the database. Please see my post: http://www.zenphoto.org/support/topic.php?id=3030&replies=6 . Since I ran into the same problem after upgrading Wordpess script here is what they say about it: Problems with character encoding in a new istall of Zen Photo - optimiced - 2008-05-22 @trisweb: Hmmm, not sure... OK, what I have discovered: In the MySQL database I cannot read the data, when in UTF-8. If I switch encoding in the browser to Windows-1251, data becomes perfectly readble! So, it's encodings' mismatch, I guess?? Front-end is UTF-8, data is passed to the database, which doesn't store it as UTF-8 but as win-1251. Why? I don't know. For some reason, the SET NAMES works incorrectly then, or incompletely... these are just guesses, I don't know... Hm. Problems with character encoding in a new istall of Zen Photo - Bilder-Freak - 2008-08-27 try to switch utf-8 off before updating your database and switch it on after updating - this works for me. |