It is currently Tue Dec 12, 2017 3:00 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Charset conflicts
PostPosted: Mon Sep 20, 2004 7:14 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
Whenever I attempt to fetch a document from the forum, Apache is specifying the character set to be ISO-8859-1, causing Mozilla and Firefox to IGNORE the charset defined in the document's <meta http-equiv...> tag. As a result, ALL forum languages are being displayed as ISO-8859-1 rather than the character sets they specify.
If I recall correctly, the problem is within PHP's configuration - it has a way to specify a default character set, whicih must be DISABLED in order for this to work properly.


[EDIT]
An alternate fix for this problem is as follows:
1. Open includes/page_header.php
2. At the end, locate the line `$template->pparse('overall_header');`
3. Before that line, insert `header ('Content-Type: text/html; charset=' . $lang['ENCODING']);`
4. Open admin/page_header.php
5. At the end, locate `$template->pparse('header');`
6. Before, insert `header ('Content-Type: text/html; charset=' . $lang['ENCODING']);`

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 20, 2004 7:50 am 
It's early in the morning, so pardon me if I'm off my rocker. *still rubbing his eyes*

I don't think this kind-of change is possible; PHP is run as a CGI, not an Apache module.

Meaning, there's no way (I know of) to set default_charset to "" (to disable PHP sending the HTTP Charset: header, as mentioned here) outside of using "php_value" or "php_admin_value" inside of Apache via .htaccess or the httpd.conf.

I would think using ini_set() inside of PHP would come too late in the process (default HTTP headers already being sent at that point), but I really don't know just how much of a "pre"-parser PHP is, if you get my drift. Otherwise, I'd probably just use ini_set() inside of phpBB's extension.inc.


Top
  
 
 Post subject: Re: Charset conflicts
PostPosted: Mon Sep 20, 2004 7:55 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Quietust wrote:
An alternate fix for this problem is as follows:
1. Open includes/page_header.php
2. At the end, locate the line `$template->pparse('overall_header');`
3. Before that line, insert `header ('Content-Type: text/html; charset=' . $lang['ENCODING']);`
4. Open admin/page_header.php
5. At the end, locate `$template->pparse('header');`
6. Before, insert `header ('Content-Type: text/html; charset=' . $lang['ENCODING']);`


I've deployed this -- so far it looks legit.

There sure seems to be an awful lot of oversights in this forum software...


Top
 Profile  
 
 Post subject: Re: Charset conflicts
PostPosted: Mon Sep 20, 2004 9:07 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
koitsu wrote:
I've deployed this -- so far it looks legit.

And it looks good here, too. Firefox is finally displaying the Japanese language pack in UTF-8 like it's supposed to.

Quote:
There sure seems to be an awful lot of oversights in this forum software...

The phpBB team actually knows about this problem already; they simply decided to defer fixing it until phpBB 2.2 (which is still pretty far from release).

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject: Re: Charset conflicts
PostPosted: Mon Sep 20, 2004 11:22 am 
Good deal. Also solved the Email issue, and tinkered with some of the style colours a bit... I'm really going to need tepples or someone else to go through those and figure out what looks good for the boards.

Of course, this is also just a "test run" -- if the back-end db gets horked or we break something in the process, it's not a big deal. Entirely different if and when the board gets moved or migrated... :)

Wiki stuff is coming along well (blargg dropped me an Email), I see!


Top
  
 
 Post subject:
PostPosted: Mon Sep 20, 2004 11:22 am 
That reply should've been from me, koitsu. Damn login things... ;D


Top
  
 
 Post subject:
PostPosted: Sat May 07, 2005 5:25 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
Er, it looks like this problem has reappeared...

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 07, 2005 5:50 pm 
Sounds like my upgrade of MySQL 4.0.8 to 4.0.11 somehow "broke" the default table settings. I'll fix it after I take care of some stuff first.

Pretty weird that it'd break though. Very odd...

-- koitsu


Top
  
 
 Post subject:
PostPosted: Sat May 07, 2005 5:51 pm 
That should be 4.1.8 to 4.1.11, sorry. God I'm going brain-dead...


Top
  
 
 Post subject:
PostPosted: Sat May 07, 2005 7:57 pm 
Looks like its not related to MySQL this time, but rather the server headers.

I see a lot of the PHP scripts for the board here updated on May 7th (today) about 5 hours ago, so my guess is that memblers upgraded it or something along those lines.

The problem looks like the Content-Type being sent in the HTML is iso-8859-1 regardless of what the actual content is, so I'll have to go fix all of that up... Heh. :-)


Top
  
 
 Post subject:
PostPosted: Sat May 07, 2005 8:11 pm 
Yep, found that some of the language/ files had been changed (particularly lang_english's stuff) back to iso-8859-1. I set it to utf-8. The other languages were not touched (still utf-8).

In addition, the include/ and admin/ php files mentioned in this thread had also been updated and lacked the set-lang-encoding code.

According to my peers, things are working now. View Source shows the right thing, so I believe its working okay.

Let me know. :-)

-- koi


Top
  
 
 Post subject:
PostPosted: Sat May 07, 2005 10:33 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3487
Location: Indianapolis
Yep, I updated phpBB today by uploading the changed files. Sorry if I broke something, heheh. Maybe it's safer to use the patch, but I don't know how.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2005 10:49 am 
Memblers wrote:
Yep, I updated phpBB today by uploading the changed files. Sorry if I broke something, heheh. Maybe it's safer to use the patch, but I don't know how.


Don't worry about it, man. :-) Q caught it, so it's all good.

Maybe I should write up some stupid little doc thing with some perl+sed crap which will recursively go through and fix all of it after an upgrade. *lazy zzzz*

-- koi


Top
  
 
 Post subject: Thanks
PostPosted: Thu Sep 22, 2005 1:28 pm 
Damn, i never thought of looking at it that way, thanks.


Top
  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 1:43 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
It's time to apply this fix again...

Dammit, Memblers, next time use the patch file!

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group