Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Some problems with Unicode and Browser...  (Read 3554 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
Some problems with Unicode and Browser...
« 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?
« Last Edit: December 02, 2005, 08:37:57 am by GauGau »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
Re: Some problems with Unicode and Browser...
« Reply #1 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.
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Re: Some problems with Unicode and Browser...
« Reply #2 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
Logged
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

  • Guest
Re: Some problems with Unicode and Browser...
« Reply #3 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.
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
Re: Some problems with Unicode and Browser...
« Reply #4 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?
Logged

Nibbler

  • Guest
Re: Some problems with Unicode and Browser...
« Reply #5 on: December 02, 2005, 08:51:38 pm »

The setting you added will just be ignored, it will work fine.
Logged
Pages: [1]   Go Up
 

Page created in 0.132 seconds with 19 queries.