Reputation: 1778
I have an issue with character encoding:
I have this page: http://www.studiomille.jp/class/
(its in japanese but the character in question is from chinese i think)
FF shows it correctly, IE (all versions) and Chrome doesn't (sorry larger screenshots):
(there are other character that are different throughout the site, this is just one example)
Everything is set to UTF-8:
* PHP sends header: Content-Type:text/html; charset=UTF-8
* PHP starts with: mb_language('uni'); mb_internal_encoding('UTF-8');
* meta tag: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
* all files are saved with UTF-8 encoding with DreamWeaver CS3
* the same font is used in all the browsers.
On that page nothing comes from the db, everything is hard coded.
The site has the same behavior on my localhost too.
So why only FF gets it right and how can I make it work on IE also?
Upvotes: 2
Views: 1400
Reputation: 522626
These two characters are variants of each other but share the same code point.
See http://en.wiktionary.org/wiki/将.
The variant showing up in Firefox is the Japanese Kanji variant, the "incorrect" one is the Chinese Hanzi variant. If all you have is the code point/UTF-8 encoded character, it's ambiguous which variant should be rendered. As a great example, try copying the two different characters from the aforelinked Wiktionary entry and paste them into a different application. You'll likely end up pasting a different variant than you copied for one of them.
To solve this, you can hint the language to the browser. Taken from the Wiktionary entry:
<span lang="zh-Hans" xml:lang="zh-Hans">将</span>
<font lang="ja" xml:lang="ja">将</font>
(Not that you should be using the <font>
tag anymore...)
This is still no guarantee how the character will be rendered, but if the browser takes the hint, it should work. You should be able to set the lang
for the whole document, instead of each character individually.
Upvotes: 1