View Issue Details

IDProjectCategoryView StatusLast Update
0000525Apache 2.x Bugpublic2020-08-24 03:13
Reporterkkamiyam Assigned Topsmedley  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
PlatformpcOSOS/2 warp server for e-buisinessOS Version4.52
Product Versionv2.2.1 
Summary0000525: directive AddDefaultCharset doesn't work
DescriptionIt seemed that the directive "AddDefaultCharset" does not work.
I tried set this option to "utf-8" or "shift_jis" or "off", but always charset was set to "utf-8".
TagsNo tags attached.
Attached Files
test-sjis.htm (261 bytes)   
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="Shift_JIS">
<title>SJIS-Test</title>

<body>
<h1>Test</h1>

<p>
This page written in Japanese(Shift_JIS).
</p>

<h2>�e�X�g</h2>

<p>
���{��̕\���e�X�g�iShift_JIS�j
</p>

</body>
</html>
test-sjis.htm (261 bytes)   
test-sjis.php (261 bytes)
test-utf8.htm (264 bytes)   
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>UTF-8-Test</title>

<body>
<h1>Test</h1>

<p>
This page written in Japanese(UTF-8).
</p>

<h2>テスト</h2>

<p>
日本語の表示テスト(UTF-8)
</p>

</body>
</html>
test-utf8.htm (264 bytes)   
test-utf8.php (264 bytes)

Activities

kkamiyam

2012-01-27 04:34

reporter   ~0002202

The version of apache is 2.2.21. Also, I use PHP 5.3.8 with it.

psmedley

2012-01-27 20:59

administrator   ~0002203

Will try do some testing this afternoon, but the documentation at http://httpd.apache.org/docs/2.1/mod/core.html mentions that charset needs to be IANA listed from http://www.iana.org/assignments/character-sets

The IANA charset name seems to be Shift_JIS not shift_jis - perhaps this will make a difference?

kkamiyam

2012-01-28 07:43

reporter   ~0002204

I re-tested this issue and get a result.
When I use "normal" html format and extension(like ".htm"), the directive works correct. The problem occur in "PHP" format(use ".php" extension).

By the way, when I used apache 2.0.x with PHP 4.x.x, there were no problem. Perhaps, a factor comes from apache or PHP's specification change. Or maybe I missed my configuration.

One of the solution is use UTF-8 encoding in .php file. But I still continue to look into this issue.

regards.

psmedley

2012-01-28 08:28

administrator   ~0002205

Looking at http://www.webmasterworld.com/forum88/11331.htm what you describe seems to be working as designed.

http://www.php.net/manual/en/ini.core.php#ini.default-charset might do what you want for the PHP side of things

kkamiyam

2012-01-30 07:58

reporter   ~0002207

I got it!
In my php.ini, I set 'default-charset' directive to 'utf-8' the other day.
I changed it to be empty, then I tried to view .php files from web browser again. It seemed with no problem.
All process works fine now!

Thanks a lot for your advice.

Regards.

Issue History

Date Modified Username Field Change
2012-01-27 03:12 kkamiyam New Issue
2012-01-27 04:34 kkamiyam Note Added: 0002202
2012-01-27 20:59 psmedley Note Added: 0002203
2012-01-28 07:04 kkamiyam File Added: test-sjis.htm
2012-01-28 07:05 kkamiyam File Added: test-sjis.php
2012-01-28 07:05 kkamiyam File Added: test-utf8.htm
2012-01-28 07:06 kkamiyam File Added: test-utf8.php
2012-01-28 07:43 kkamiyam Note Added: 0002204
2012-01-28 08:28 psmedley Note Added: 0002205
2012-01-30 07:58 kkamiyam Note Added: 0002207
2012-02-01 08:37 psmedley Status new => resolved
2012-02-01 08:37 psmedley Resolution open => no change required
2012-02-01 08:37 psmedley Assigned To => psmedley
2020-08-24 03:13 psmedley Status resolved => closed