Reputation: 193
I have a strange issue with a filename. But I am not sure if it is an issue from the server or so:
The link I have on the website is follow:
http://new.anwaltskanzlei-hauser.ch/rechtsberatung_zürich.php?lang=ge
Or, if I copy and paste into here:
http://new.anwaltskanzlei-hauser.ch/rechtsberatung_z%C3%BCrich.php?lang=ge
The filename on the server is: rechtsberatung_zürich.php .
So, I do not know, what exactly I need to change, that I have a filename called rechtsberatung_zürich.php
I know it is an issue with the charset and so on. Any help?
Upvotes: 1
Views: 6656
Reputation: 351
I would just do a site wide unicode cleanup, read directories, glob directories, read file paths, file name, and files, and convert everything to use a single character set, preferably utf-8 or utf-32, then use that character set for everything, server, db, scripting, etc, etc, and you can use the PHP mb_ function set to do all that.
<?php
function fixEncoding ( $string, $e_f, $e_t )
{
return mb_convert_encoding ( $string, $e_f, $e_t );
}
$string = "Italienische Gemüsesuppe";
$encode_from = "windows-1252";
$encode_to = "UTF-8";
echo fixEncoding ( $string, $encode_from, $encode_to ) . "\r\n";
?>
Upvotes: 0
Reputation: 351
I would just do a site wide unicode cleanup, read directories, glob directories, read file paths, file name, and files, and convert everything to use a single character set, preferably utf-8 or utf-32, then use that character set for everything, server, db, scripting, etc.
Upvotes: 0
Reputation: 189
Its a problem with UTF-8 charset, it doesnt support some lation characters. Probably you should use ISO-8859-1 charset encoding in place of UTF-8.
Upvotes: -4
Reputation: 536409
As the page looks fine from the outside I don't think you need to change anything on the server.
The filename on the server is: rechtsberatung_zürich.php .
Sounds like you are using a file transfer tool that treats the server's filesystem as being in the windows-1252
encoding, when actually the server treats it as being UTF-8.
How exactly you change the encoding that your file transfer tool assumes for remote filesystems varies depending on what the tool is. For example with WinSCP there is the UTF-8 Encoding for Filenames option.
(If you are using the support for FTP built-in to Explorer then there's nothing you can do, it always uses your local machine's default locale encoding, which is never UTF-8, unfortunately. But you don't want to be using FTP in this century, you should try to move to SFTP in any case.)
Upvotes: 5
Reputation: 1
you can format charset if it is in a db as comparision 'utf8_general_ci' language options
Upvotes: 0