[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Input Chinese Characters in Edit Box or Memo

I'd like to input Chinese font in Edit or Memo. I changed the font property to "SimSun" (Script=CHINESE_GB2312).
Also, the Chinese font has been installed in my PC. I found that it can display Chinese charactors, via Copy-Paste.
I'm try to use Windows XP's Chinese Input Tool, I can only get "?" shown in the Edit box or Memo1. Any sugestions?

ysimon
0
ysimon
Asked:
ysimon
  • 4
  • 3
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
0
 
ysimonAuthor Commented:
It works.
However, I'd like to get the Unicode value (2 bytes) and to put it into the standard Edit or Memo.
For example:

Memo1.Lines.Append(TntEdit.Text);       Doesn't work, only works for Ascii

TntMemo1.Lines.Append(TntEdit.Text);  OK

What should I do?

ysimon
0
 
DragonSlayerCommented:
Why would you want to do that? Delphi's controls do not support Unicode...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ysimonAuthor Commented:
Delphi components can display Charactors if their Font is changed, however, the Code must be GB instead of Unicode. So I'd like to know how to convert the Unicode to GB code
for example:

Chinese   Unicode    GB
Fa           D1 53       B7 A2

ysimon
0
 
DragonSlayerCommented:
You will need to use the function WideCharToMultiByte to convert from Unicode to GB, and MultiByteToWideChar to convert from GB to Unicode.
0
 
DragonSlayerCommented:
Oh, the codepage to use is 936, refer to the Win32 API help file, and look under "codepage" for more codepages... i.e. Big5, etc.
0
 
ysimonAuthor Commented:
Thank you Dragon Slayer.
0
 
DragonSlayerCommented:
no probs. Glad to help!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now