coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: ramones79 on July 17, 2008, 10:09:21 PM

Title: [Solved]: UTF-8 decodes incorrectly in IE 6
Post by: ramones79 on July 17, 2008, 10:09:21 PM
So the problem is simple:

I use Bulgarian language for my Coppermine Gallery. Version is:

SVN version info:
  Coppermine version: 1.4.18
  $Revision: 4380 $
  $LastChangedBy: gaugau $
  $Date: 2008-04-12 12:00:19 +0200 (Sa, 12 Apr 2008) $

The problem is with Internet Explorer 6 and it's bad behavior when decoding UTF-8 pages.
In FireFox 2 the page is great - everything is fine.
In Internet Explorer 6 - the page is in Bulgarian - and if I choose Encoding -> UTF-8 it becomes readable and ok. But IE 6 doesn't do that automatically and I dunno why.
When I load the gallery with IE 6 the default charset is set to Auto select /enabled/ and Western European /ISO/ selected.
I even tried to change the header /DOC TYPE definition/ of the template with the one from Joomla 1.5 where IE6 handles UTF-8 just great. But it still didn't worked. So I guess the problem is Coppermine-specific, perhaps something in the inside-settings.

I really hope you can help me.

I'm waiting for your reply,

with regards,
Ilia Penchev

P.S. Here is the Gallery: http://www.dani-din.com/cgallery/index.php
and this is the home page of the web site http://www.dani-din.com
Title: Re: UTF-8 decodes incorrectly in IE 6
Post by: Joachim Müller on July 18, 2008, 06:51:32 AM
<html xmlns="http://www.w3.org/1999/xhtml"
   xml:lang="bg-bg" lang="bg-bg" >
is nonsense, as Bulgarian is not part of the specification. That piece of code is not meant to specify the language of the content. Your custom theme is missing some vital aspects - edit http://www.dani-din.com/cgallery/themes/dani/template.html and replace <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xml:lang="bg-bg" lang="bg-bg" >
  <head>

<meta http-equiv="Pragma" content="no-cache" />
with<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
Don't make that stuff up - if you have no idea what it does and how much browsers rely on the correct headers, don't edit them.
Your page looks strange in Firefox as well btw, since your edits not only confuse IE, but every browser.
Title: Re: UTF-8 decodes incorrectly in IE 6
Post by: ramones79 on July 23, 2008, 11:02:28 AM
Hi and thank you for helping me.

I have changed the header as you say, but unfortunately it doesn't help :( In FireFox it is again OK and IE 6 can't set the automatic encoding to UTF-8 with this header.

About you saying that FireFox doesn't display the text correctly either - you're not right, or maybe my Firefox displays it OK because it's a bulgarian translated version, but it works.

Here are some screenshots, which maybe of some help to lead us to the problem:

Screenshot from Internet Explorer 6 - with the new header : http://www.topvisia.net/s01.jpg [Edit GauGau] Replaced hotlinked image with attachment s01.jpg [/Edit]
Screenshot from Firefox 2.0.0.16 with the new header: http://www.topvisia.net/s02.jpg [Edit GauGau] Replaced hotlinked image with attachment s02.jpg [/Edit]

The old header, which you say is not according to the specifications, actually its the header that Joomla 1.5 uses and pages with bulgarian text and this header are displaying correctly even in Internet Explorer 6, you can see that here:
screenshot IE6 and Joomla 1.5 - correctly decoding UTF-8: http://www.topvisia.net/s03.jpg [Edit GauGau] Replaced hotlinked image with attachment s03.jpg [/Edit]
the last screenshot is from http://www.martinakomers.com (http://www.martinakomers.com) so you can see for yourself.

Hope this more information can help ?  ???
Title: Re: UTF-8 decodes incorrectly in IE 6
Post by: ramones79 on July 23, 2008, 11:07:54 AM
here are the links to the screenshots for better display:

IE 6 with new header http://www.topvisia.net/s01.jpg (http://www.topvisia.net/s01.jpg)
Firefox with new header http://www.topvisia.net/s02.jpg (http://www.topvisia.net/s02.jpg)
Joomla 1.5 with old header but displaying ok in IE6 http://www.topvisia.net/s03.jpg (http://www.topvisia.net/s03.jpg)
Title: Re: UTF-8 decodes incorrectly in IE 6
Post by: Nibbler on July 23, 2008, 11:13:43 AM
Set Coppermine's encoding to UTF-8 in config.
Title: Re: UTF-8 decodes incorrectly in IE 6
Post by: ramones79 on July 23, 2008, 11:38:35 AM
Nibbler thank you man !

I am so stupid that I admit I'm the biggest no0b here  ;D

It works now PERFECTLY !!!! yeaaah :> You made me happy.

I can't believe how I didn't checked all config settings before changing headers, etc. Can't be true - I thought it is a much bigger problem (IE bugs, etc) :)

Hooray ! You have a drink on me, whenever you come to Bulgaria, I mean it ;)
Title: Re: [Solved]: UTF-8 decodes incorrectly in IE 6
Post by: Joachim Müller on July 23, 2008, 07:02:42 PM
You must have messed with that setting, as coppermine uses utf-8 when it gets set up in the first place. You have caused all your issues because you messed with settings you shouldn't have messed with.