Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 09:21

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Strange encoding problem
PostPosted: 16. May 2010, 13:24 
Offline

Joined: 16. May 2010, 13:05
Posts: 5
Hi,

after succesfully running TWG on my home server, I am now trying to use it for the galleries of our choir on a different server. I have run into a problem I am unable to solve - when I change the language to Czech, the accented characters are corrupted (more specifically: converted from UTF-8 to 8859-1 and then displayed as UTF-8, resulting in a mix of non-displayable characters and questionmarks). The folder names are correct, though.
I have verified the following points:
- web pages are displayed in UTF-8
- language setting in language_cz.php is UTF-8
- all files were transferred using FTP in binary mode

I have even tried to copy the entire installation from my own server to the target site and the result is the same - the site works at home and does not on the other server.
Do you have any idea what to try and what to check? The server environment is a bit different, Linux instead of WinXP on my home server, with PHP 5.2.12 instead of 5.3.1.

Thans for any idea,

Stanislav.


Top
 Profile  
 
 Post subject:
PostPosted: 16. May 2010, 14:58 
Offline

Joined: 16. May 2010, 13:05
Posts: 5
... as I understand - there are just two operations involved - string definition and echo() function. Is there any PHP (or Apache 2) config value affecting the way the strings are loaded into memory upon their definition?


Top
 Profile  
 
 Post subject:
PostPosted: 16. May 2010, 17:03 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
for me it seems the language file is not utf-8. Have you tried to load it ino an text editor and save it as utf-8 again?
A lot of editors display wrong values if you only show at the details of a file.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 16. May 2010, 17:43 
Offline

Joined: 16. May 2010, 13:05
Posts: 5
Sure - when I download it using TotalCommander (binary transfer) and view it using F3 or UltraEdit, the file is in UTF8 without any doubt (there is even the correct BOM at the beginning - EFBBBF). The only explanation I can imagine is that the Apache or PHP incorrectly decide about the encoding of the file when they load it - could any meta tag help? As I wrote - exactly the same installation works on one server and does not on another, so it must be something within the server software itself.

Stanislav.


Top
 Profile  
 
 Post subject:
PostPosted: 16. May 2010, 19:27 
Offline

Joined: 16. May 2010, 13:05
Posts: 5
Another piece of puzzle - I have tried to display string length on one server and another and they really do differ:
echo strlen($lang_select_gallery);
(where this string contain one accented character) yields 24 on the correct server and just 23 on the incorrect one. So it is definitely a problem of loading of the language file by PHP. How can one influence that?

Furthermore - my_config also contains accented characters and is loaded correctly...


Top
 Profile  
 
 Post subject: SOLUTION!
PostPosted: 16. May 2010, 20:29 
Offline

Joined: 16. May 2010, 13:05
Posts: 5
I have solved this problem by deleting the UTF8 BOM from the language_cz.php file. Can anyone explain, why Linux does not like BOMs?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy