|
Comment problem (charset)
|
|
10-23-2011, 10:05 PM
Post: #1
|
|||
|
|||
|
Comment problem (charset)
Hello! Thank you for cool gallery script!
I've got a problem: when I'm posting comments in russian language and then try to read it, I get it in wrong charset. Your demo works well, russian language is accepted correctly. I did a little investigation: comment is saved in .txt file in utf-8 charset, but when it is read to display it is in cp1251. So if I manually convert saved comment to ANSI then comment is displayed correctly. Please, tell how to fix this. Thank you! |
|||
|
10-24-2011, 08:38 AM
Post: #2
|
|||
|
|||
|
RE: Comment problem (charset)
Your html-document where the gallery is inserted has to be utf-8 saved. Also don't forget to add the metatag about the correct doctype:
PHP Code: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> KoschtIT Image Gallery developer |
|||
|
10-24-2011, 04:22 PM
Post: #3
|
|||
|
|||
|
RE: Comment problem (charset)
All of my files are saved in utf-8.
Here is the code of the php page: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">What problem it can be? |
|||
|
10-24-2011, 06:16 PM
Post: #4
|
|||
|
|||
|
RE: Comment problem (charset)
What "default_charset" is set in your PHP configuration? Mine is either not set at all or UTF-8. Both configurations are working correctly with the example-page you provided. My comments are also saved in utf-8.
KoschtIT Image Gallery developer |
|||
|
10-24-2011, 09:35 PM
(This post was last modified: 10-24-2011 10:19 PM by Destroyer.)
Post: #5
|
|||
|
|||
|
RE: Comment problem (charset)
Here is my php.ini part:
Code: ; PHP's built-in default is text/htmlCode: default_charset = "utf-8"I even tried to put .htaccess file with "AddDefaultCharset utf-8" near index.php (I showed the code of this file above), but nothing helps. But when I uploaded sample script to the hosting - it works well, charset is correct. After adding "ini_set("default_charset", "utf-8");" to index.php phpinfo(); on local server, it shows - default_charset local val.:utf-8 Master val.: windows-1251. On hosting server it shows - default_charset local val.:no value Master val.: no value I've got windows server and default charset is cp1251 here, even if I change it in php.ini. Any suggestions what is wrong in my local server configuration? [/code] Finally I found, that I was editing wrong php.ini file. I changed to default_charset = "utf-8" and the problem is solved. Thanks! |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)





