Delphi2010 generating GB2312 font garbled problem

Source: Internet
Author: User

Use Delphi2010 to do a lattice font software, the font generation part is from a Delphi2007 do the old program to buckle out. Dot matrix font Software after the completion of the generation of GB2312 font in the LED control card displayed as garbled. Know that Delphi version is higher than 2009 (inclusive), then Delphi is a Unicode version, the old program is no problem, then the problem is definitely in the code to the character section, and then found

s:string;

S: = Chr (Q) + CHR (W); Q and W are high-byte and low-byte GB2312 area codes, respectively

The GB2312 Code table found the "Ah" area code for B0A1, with

ShowMessage (Chr ($B 0) + chr ($A 1););

The displayed characters are not correct.

Delphi version is higher than 2009 (inclusive), then Delphi is the Unicode version, the function CHR returns the corresponding encoded Unicode characters. For English letters, numbers and so on, and the return of the lower version of the same, for Chinese characters, it is generally returned the corresponding encoded Unicode characters.

Then instead of Ansichar ();

ShowMessage (Ansichar ($B 0) + Ansichar ($A 1));

The display character is "ah".

This solves the problem.

Delphi2010 generating GB2312 font garbled problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.