Reputation: 71
I have simple page in php which gets argument with get method. The page just prints the argument. Nothing more. It works properly with english chars. If i pass as argument value in some Unicode language (etc Russian), then the value of the argument printed as question marks.
How to solve the issue?
Thank you, Yuri
P.S. adding header with utf-8 doesn't help.
this is the get: mypage.php?src=uploaded_files/пока.mp3
this is the encoding: <meta http-equiv="content-type" content="text/html; charset=utf-8">
and this is the output: uploaded_files/????.mp3
Upvotes: 1
Views: 1228
Reputation: 16762
I think the problem may be that PHP does not nativley support Unicode. From the Strings doc page
A string is series of characters, therefore, a character is the same as a byte. That is, there are exactly 256 different characters possible. This also implies that PHP has no native support of Unicode. See utf8_encode() and utf8_decode() for some basic Unicode functionality.
That page reccomends if you want to use unicode that you encode it uses utf8_encode
$r = "пока.mp3"
$s = utf8_encode($r);
Upvotes: 1