[Touch HD Windows Mobile ROM Development] RobRedbeard:
A lot of folks here have posted in various ROM's threads about how to get Chinese language to display. I've responded to many of these, made several cabs, and now I'd like to just make a single instruction post to try to cover it all. Like everyone here, I'm a user who's learned by reading and doing. If you find any mistakes in my instructions, just let me know, and I'll cheerfully update them. I post them here in the hope that they can be useful.

Introduction and Background:

Regional Settings

In Windows Mobile, there is a settings panel called, "Regional Settings." It is used to change your date, time, and currency formats to match those of your culture. If you open that on your phone, you'll see that there are many entries in the drop down box of regions. The entries in this box are completely dependent on a single file called "WinCE.nls" and found in your Windows directory on your device.

Ultimately, the WinCE.nls file is important for an altogether more important purpose -- if your messages, e-mail, or whatever are not Unicode, then the region that they are from MUST be included in your WinCE.nls file for them to display properly.

Unicode makes it easy

First of all, your Windows Mobile device is completely able to display Chinese but lacks the font files to display the characters. After properly installing a font file (see below) Unicode-encoded e-mails, text messages, and software will all properly display on your WinMo. Consult Wikipedia for more on Unicode.

Double Byte makes it a pain

When we invented the computer, we designed it around an English centric world, because that's where it was made and used. However, today computers are prolific throughout the world.

For most regions, the challenge of incorporating their languages into computers was easy. Character translation tables could simply be replaced to substitute one alphabetic character set with another that included the special needs and accents of other languages (think French).

However, there was a special challenge for Chinese and the languages that borrowed and incorporated Chinese characters (Korean, Japanese, etc). There was no way to fit all of the thousands of characters in an 8bit character space (which would only allow for 256 possibilities). The solution (some 20 years ago) was to use two bytes to represent a single Chinese character. In programming terms, this is called double byte encoding and it gives 16 bits per character, which can represent 65500+ different possible characters per space. Perfect, right? Wrong.

Every large character set region created their own double byte encoding. In mainland China, GB2312 was used. But GBK also exists. In Hong Kong there's Big5, in Taiwan as yet another and so on. With so many what can you do?

Well luckily with e-mail, Windows Mobile is pretty savvy. If your wince.nls file in your \Windows directory contains an encoding for a region (even if it isn't your presently selected region), Pocket Outlook will be able to display e-mail properly. Unfortunately, most ROMs don't include a wince.nls file with most regions' encodings. Don't worry though, I've attached one here.

List of tasks

We need to:

Install a font

Alias and Link that font

Install a proper WinCE.nls file

(Optional for old software) Change your phones region setting

Install a font

There is some confusion as to whether fonts should be copied to \Windows or \Windows\Fonts. The traditional way before was for the latter and I still see a lot of instructions that say this. I install Japanese in my Windows\Fonts directory and MSYH.ttf in my \Windows directory. Both work for me.

Alias Your Font

Set FontAlias entries. These tell your system that whenever one of those fonts is asked for (by your software) that it ought to actually give it the other font.

Below are the entries for Simplified Chinese (SC_Song). Note that we're setting everything to point to Tahoma. After this we'll fontlink our foreign font with Tahoma so that Tahoma can be used as a single font for any languages we want.

REGEDIT4

[HKEY_LOCAL_MACHINE\System\GDI\V1\FontAlias]
"Tahoma:-9"="Tahoma:13"
"Tahoma:-11"="Tahoma:13"
"version"=dword:0009000C
"SC_Song:14"="Tahoma:14"
"SC_Song:10"="Tahoma:13"
"SC_Song:12"="Tahoma:14"
"SC_Song:18"="Tahoma:14"
"SC_Song:16"="Tahoma:14"
"SC_Song:15"="Tahoma:14"
"MS Shell Dlg:8"="Tahoma:13"
"System:14"="Tahoma:13"
"System:8"="Tahoma:13"
"Tahoma:16"="Tahoma:13"
"Tahoma:14"="Tahoma:13"
"MS Sans Serif:-13"="Tahoma:13"
"Arial:-14"="Tahoma:13"
"Tahoma:17"="Tahoma:14"
"Tahoma:18"="Tahoma:14"
"Tahoma:20"="Tahoma:14"
"Tahoma:-10"="Tahoma:13"

Link your Font

By setting FontLink entries we can link any foreign font we want to Tahoma and use it as a single solution for all our font needs.

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Microsoft\FontLink\SystemLink]
"MSYH"="\\Windows\\msyh.ttf,MSYH"
"HelveticaNeue LT 55 Roman"="\\Windows\\msyh.ttf,MSYH;\\windows\\tahoma.ttf,Tahoma;\\windows\\tahoma.ttf,Tahoma"
"Helvetica Neue OTS"="\\Windows\\msyh.ttf,MSYH;\\windows\\tahoma.ttf,Tahoma;\\windows\\tahoma.ttf,Tahoma"
"HelveticaNeue LT 35 Thin"="\\Windows\\msyh.ttf,MSYH;\\windows\\tahoma.ttf,Tahoma;\\windows\\tahoma.ttf,Tahoma"
"Courier New"="\\windows\\tahoma.ttf,Tahoma"
"Courier"="\\windows\\tahoma.ttf,Tahoma"
"Arial"="\\windows\\tahoma.ttf,Tahoma"
"Nina"="\\windows\\tahoma.ttf,Tahoma"
"MS Sans Serif"="\\windows\\tahoma.ttf,Tahoma"
"Tahoma"="\\Windows\\msyh.ttf,MSYH;\\windows\\tahoma.ttf,Tahoma"
"Segoe UI"="\\windows\\tahoma.ttf,Tahoma"
"Segoe condensed"="\\windows\\tahoma.ttf,Tahoma"
"Segoe"="\\windows\\tahoma.ttf,Tahoma"
"Times New Roman"="\\windows\\tahoma.ttf,Tahoma"
"Symbol"="\\windows\\tahoma.ttf,Tahoma"
"PMingLiu"="\\Windows\\tahoma.ttf,Tahoma"
"NSimSun"="\\Windows\\tahoma.ttf,Tahoma"
"Kingsoft Phonetic Plain"="\\Windows\\msyh.ttf,MSYH"
"Unisun"="\\Windows\\msyh.ttf,MSYH"
"SIMSUN"="\\windows\\tahoma.ttf,Tahoma"
"SC_Song"="\\windows\\tahoma.ttf,Tahoma"

Install a proper WinCE.nls file

This step is only actually necessary if you may receive e-mail or files that are NOT unicode. Unfortunately, I still get quite a few, you won't reach perfection unless you do this. Luickly it's easy.

1) Download the attached WinCE.NLS.zip

2) Unzip it.

3) copy the wince.nls file to your phone somewhere (smart people might select a location on their SD cards).

4) Use TotalCommander to copy that file to your \Windows dir.

5) Soft reset.

6) If your setting up your phone from a new flash, do all of the above BEFORE you sync your e-mail for the first time.

*(Optional) Change your region

Some old software is written using Double Byte methods instead of Unicode. If you can, just upgrade to a new version, but if you can't you'll have to change your phone to the appropriate region for that software's encoding.

Symptoms of problem two are that you run something like 阿里巴巴 支付宝 (a PPC program for the Chinese paypal clone, Alipay) and some Chinese displays but some areas don't (that program sloppily mixes Unicode and GB2312 encodings).

1) Open Start->Setting->System: Regional Settings

Select China PRC or whatever region you need for your software.

2) Soft Reset.

Outro

I hope these instructions help. They are written for Simplified Chinese support, but should be very easily adapted to Traditional, Japanese, or anything else. You'll just need to know which fonts are commonly used by those systems and setup your aliasing for them. SC_Song for example, is a commonly used Chinese font, so I fontalias'ed it for my purposes. You'll need to adapt this to yours if you have another language need.

What about Chinese input?

You could always do that. You just need an IME. Search for "A4 Dopod 2.9" on Google.cn (yes, .cn not .com).

Rob