Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a pinyin string to chinese in C#

Tags:

c#

wpf

cjk

I have a touch screen keyboard in my WPF application and I would like to allow the users to write in chinese.

I saw that there is an IME in Windows that allows to write in chinese with Pinyin. It works great but I'd like to customize it for my WPF application. (Especially the candidate list). I didn't find any documentation for this.

The idea will be that the user write in Pinyin with the virtual keyboard and there will be a list of choice with chinese ideograms next to the textbox.

Do you have any advice to achieve it? Maybe there is a library (not from Microsoft) that can make it and in this case I won't use the IME from MS?

like image 713
Rodrigue Rens Avatar asked Mar 02 '12 15:03

Rodrigue Rens


1 Answers

http://www.microsoft.com/downloads/zh-cn/details.aspx?FamilyID=7D1DF9CE-4AEE-467F-996E-BEC826C5DAA2

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=15251

Microsoft in fact has good components/libraries for that, but they are hidden here in the Visual Studio International Feature Pack.

Note that You need 1.0 SR 1 which provides the basic libraries, while 2.0 adds many WinForms or WPF controls.

(Updated on Oct 26, 2017. Many guys have published NuGet packages on NuGet.org based on Microsoft's code, so you might also check those packages out.)

like image 182
Lex Li Avatar answered Oct 20 '22 05:10

Lex Li