Bug: Timestamp does not get UTF-8

goeran

Joined: 2010-02-16
Posts: 2
Posted: Tue, 2010-02-16 19:07

I believe I've found a bug in the handling of character encodings. My system is UTF-8, so when for example using itemadd to add a bunch of photos I want to see their names in UTF-8. By default I got ISO-8859-1. I was a little surprised by this, but after adding

Quote:
$gallery->setConfig('systemCharset', 'UTF-8');

to my config.php most things became UTF-8.

But the EXIF DateTime field was not. It showed the question mark on inverse background used for non-UTF-8 characters where I expected non-ASCII Swedish characters.

I investigated a bit in this. In GalleryTranslator.class the locale is set to, in my case, sv_SE. That is irrespectively of any value of systemCharset. sv_SE is a ISO-8859-1 locale. The correct UTF-8 locale on this system would be sv_SE.utf8.

I tested by modifying the code in GalleryTranslator.class to explicitly add the ".utf8" suffix, and now things seems to work. Both file names and dates looks right.

This is of course not a fix to the problem. With my patch, the locale is unconditionally set to UTF-8. But to me it seems to confirm that there is a bug here.


Gallery version: 2.3.1
PHP version: 5.3.1
PHPInfo Link: http://www.uddeborg.se/gallery2/phpinfo.php
Webserver: Apache 2.2.24
Database: MySql 5.1.42
Activated toolkits: ImageMagick
Operating system: Fedora Linux
Browser: Firefox 3.5.6