forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Makc666 on December 02, 2005, 01:35:36 am

Title: Some problems with Unicode and Browser...
Post by: Makc666 on December 02, 2005, 01:35:36 am
I have finished new  Russian translation.
As the 1.4.x branch uses UNICODE I set:
$lang_charset = 'utf-8';

Then I go to Config panel and set
Gallery name and Gallery description
in Russian letters.

Then I swtich to English language and... I see abracadabra in Gallery name and Gallery description.

In config panel option:
Language & Charset settings -> Character encoding  is set to Unicode (recommended) (utf-8)

When I look into HTML source when English language selected I see:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
But my browser doesn't set charset correctly... It sets Auto-Select to "Windows-1251" :( :( :(

When I swtich to Russian language and look into HTML source I see the same string:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
But my browser sets Auto-Select of charset correctly to UTF-8 :o

Where is the problem?
Title: Re: Some problems with Unicode and Browser...
Post by: Makc666 on December 02, 2005, 02:39:50 am
I found where was the problem.
In php.ini of the server there was code:
Code: [Select]
; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header.  To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
default_charset = "windows-1251"

So I just disable sending of the charsert.
As the text says you have to set this line empty:
Code: [Select]
default_charset = ""
I think this issue can be added to the FAQ.
Thanks.
Title: Re: Some problems with Unicode and Browser...
Post by: DJMaze on December 02, 2005, 07:17:37 pm
Best would be to add a line in init.inc.php

Code: [Select]
header('Content-Type: text/html; charset=utf-8');
This because all browsers, except IE, prefer the header fields instead of the meta tags
Title: Re: Some problems with Unicode and Browser...
Post by: Nibbler on December 02, 2005, 08:30:24 pm
That's already been added to 1.4.3, it's in the theme's pageheader() function.
Title: Re: Some problems with Unicode and Browser...
Post by: Makc666 on December 02, 2005, 08:43:25 pm
That's already been added to 1.4.3, it's in the theme's pageheader() function.
In other words you want to say, that when 1.4.3 will came out there will be no such problem I have with
default_charset = "windows-1251"
?
So even I will have
default_charset = "windows-1251"
in php.ini
1.4.3 will work ok?
Title: Re: Some problems with Unicode and Browser...
Post by: Nibbler on December 02, 2005, 08:51:38 pm
The setting you added will just be ignored, it will work fine.