Why does chrome render different unicode characters ””(U+2F804)”和你”(U+4F60) are the same characters

Viewed 522

In Windows 7 system, Chrome uses the "Microsoft YaHei" font to display characters U+2F804 () as U+4F60 (你)

but there is no U+2F804 corresponding character in this font.

The results found using fontCreator are shown below

click to show the image

In windows 10 System, because There is Yu Gothic font, so the result is correct.

click to show the image

click to show the image

What puzzles me is why Windows 7 will show up as U+4F60(你)

The code's URL is:http://yanglikun.github.io/encoding/code.html

I think it should display question mark、口、or other characters when there is no corresponding character in the font of Microsoft YaHei, but not the wrong character U+4F60(你)

1 Answers

A note: unicode code point and font glyphs are not directly related. The actual glyph depends on context, ligature, combining characters, language, and possibly other factors (see Unicode standard).

Unicode defines that U+2F804 is decomposable to U+4F60. Often Unicode texts are normalized by software. Either by decomposing them (so often splitting characters and accents e.g. for Latin languages), or by composing them. Such algorithms are described in Unicode. So in that case, it is considered U+4F60 semantically fully equal to U+2F804 (and preferred form). It is not frequent to see decomposition which contain the same number of code points (but also not unseen). And it is also not seldom to have decomposition in one direction, and no relation on the other direction.

This character is in CJK Compatibility Ideographs Supplement, so the important part is compatibility, and this is confirmed also by wikipedia article (https://en.wikipedia.org/wiki/CJK_Compatibility_Ideographs_Supplement).

Compatibility codepoint were introduced to simplify introduction of Unicode, by providing a lossless roundtrip conversion of other encoding. [In such manner, one could implement Unicode on different layers, without problems and fully transparent, and without requiring to change other layers (or worse: to change all stack in one step).

Related