ANSI and Unicode strings

1117阅读 0评论2007-08-08 lykent
分类:C/C++

      All 16-bit application use ANSI strings. 32-bit applications may use either ANSI or Unicode strings. ANSI application srore strings as unsigned char, each byte containing a different character. Unicode applications store strings as unsigned short, each short interger value containing a different character.
 
      To specify ANSI , declare the following codes in your project settings:
 

#define OLE2ANSI

   To specify Unicode, declare the following codes in your project settings:

#define _UNICODE

   The advantage of using Unicode in your applications is that it enables you to easily localize your application into languages such as Chinese, where two bytes are required to store character. ANSI applications require special DBSS ( Double Byte Character Set) function in order to be localized into languages such as Chinese.

      The advantage of using ANSI strings is that, in Microsoft Windows 95, the Windows system calls take ANSI strings; therefore, you must convert Unicode strings to ANSI before calling into these functions.

上一篇:PON,EPON,GPON的简单概念
下一篇:C/C++读书笔记