Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

utf-8 filenames are displayed as latin-1
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=2956
Page 1 of 1

Author:  lafcadio [ 7. Apr 2011, 23:43 ]
Post subject:  utf-8 filenames are displayed as latin-1

The names of my folders are displayed as latin-1 but they are utf-8 (e.g. the name Björn looks like Björn).

Could this be fixed? (PHP 5.2.6 on Debian 5.0)

Another problem is that I cannot use https because the action attribute of the login form begins with 'http://' regardless of what protocol is used. (I found the $_SERVER['SERVER_PORT']-variable has the value 80 when I'm using https which of course goes to port 443 - weird...).

Regards

Author:  TinyWebGallery [ 8. Apr 2011, 09:32 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

which language file do you use? The encoding is specified there.

Are the folder name directly read from disk or from a foldername.txt? - Then please make sure that your files are saved in UTF-8.

TWG does completely run with UTF-8 so öäü are normally no problem.

And which login do you mean? Because at actions I don't specify the protocol. This is done by the server.
and if $_SERVER['SERVER_PORT'] = 80 then you server configuration seems not to be right.


- Michael

Author:  lafcadio [ 8. Apr 2011, 14:44 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

TinyWebGallery wrote:
which language file do you use? The encoding is specified there.
de
Quote:
Are the folder name directly read from disk or from a foldername.txt?
Directly from disk. Seems I have to create a foldername.txt for each folder.
Quote:
And which login do you mean? Because at actions I don't specify the protocol. This is done by the server.
I mean the admin login.

In admin/_include/login.php in the login form a function make_link(...) is called (defined in admin/_include/fun_extra.php) which uses a variable $GLOBALS["script_name"] which is defined in admin/_config/conf.php.

I added
Code:
$GLOBALS["script_name"] = $_SERVER['PHP_SELF'];
which fixes it for here and now.
Quote:
$_SERVER['SERVER_PORT'] = 80 then you server configuration seems not to be right.
Seems to be a buggy PHP-Version.

Author:  TinyWebGallery [ 9. Apr 2011, 00:25 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

German should work fine - because I'm German and always test in English and German.
Maybe it is an encoding Problem from the file system TWG is running.

Do you have any details here?
And does using a foldername.txt work?

If you like you can already use the 1.8.5 preview from the forum. There the folder name can be set in the frondend and the foldername.txt is created automatically.

admin/_config/conf.php. should be file if the port is set right.

If you change it be aware if you update TWG this config file is overwritten.

Best,
Michael

Author:  lafcadio [ 11. Apr 2011, 17:50 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

Quote:
Maybe it is an encoding Problem from the file system TWG is running.

It's a Debian 5.0 (lenny) Linux which's default file system encoding is utf-8. When i execute the following php-script in the twg install dir:
Code:
<?php
header
('Content-Type: text/plain; charset=UTF-8');
$dir = "./pictures/";

if ($dh = opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
        echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
    }
    closedir($dh);
}
?>

everything looks fine. I don't know what happens to the filenames in twg...
Quote:
And does using a foldername.txt work?
Yes.
Quote:
admin/_config/conf.php. should be file if the port is set right.

The port-variable was indeed set incorrectly due to a mistake in the server configuration. It works now.

Author:  TinyWebGallery [ 11. Apr 2011, 17:56 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

Then please set

$filesystem_encoding = "";

to utf-8.

- Michael

Author:  lafcadio [ 12. Apr 2011, 12:24 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

TinyWebGallery wrote:
Then please set

$filesystem_encoding = "";

to utf-8.

Works. Thank you!

Sorry, I just should have read the config file.

Author:  TinyWebGallery [ 12. Apr 2011, 13:03 ]
Post subject:  Re: utf-8 filenames are displayed as latin-1

too many config options ;)....

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/