Some problems with Unicode and Browser... Some problems with Unicode and Browser...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Some problems with Unicode and Browser...

Started by Makc666, December 02, 2005, 01:35:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Makc666

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?

Makc666

I found where was the problem.
In php.ini of the server there was code:
; 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:
default_charset = ""

I think this issue can be added to the FAQ.
Thanks.

DJMaze

Best would be to add a line in init.inc.php

header('Content-Type: text/html; charset=utf-8');

This because all browsers, except IE, prefer the header fields instead of the meta tags
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

Nibbler

That's already been added to 1.4.3, it's in the theme's pageheader() function.

Makc666

Quote from: 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.
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?

Nibbler

The setting you added will just be ignored, it will work fine.