Charset conflicts
Moderator: Moderators
Charset conflicts
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']);`
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.
P.S. If you don't get this note, let me know and I'll write you another.
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.
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.
Re: Charset conflicts
I've deployed this -- so far it looks legit.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']);`
There sure seems to be an awful lot of oversights in this forum software...
Re: Charset conflicts
And it looks good here, too. Firefox is finally displaying the Japanese language pack in UTF-8 like it's supposed to.koitsu wrote:I've deployed this -- so far it looks legit.
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).There sure seems to be an awful lot of oversights in this forum software...
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
P.S. If you don't get this note, let me know and I'll write you another.
Re: Charset conflicts
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!
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!
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.
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.
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
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
Don't worry about it, man. Q caught it, so it's all good.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.
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