Also say unicode

xiaoxiao2021-03-05  25

The emergence of Unicode is to adapt to the needs of software internationalization. Unicode is different from the double-byte character set (DBCS). First, the related operation function 1, DBCS use the following function operation string: charnext - get the latter character charprev - get the previous character isdbcsleadbyte - Judgment whether it is the first byte C runtime for two byte characters The library provides a series of functions operating DBCs at the beginning of "_MBS". Similar functions have _MBSCAT, etc.

2, ANSI character set is a US standard. The C runtime library provides this character set with some columns starting with "Str".

3. The C run library provides a series of functions starting with the "WCS" in the Unicode character set.

Second, the corresponding data type 1 is defined as Char for ANSI characters. 2. For Unicode characters defined as WCHAR_T.

Third, use the environment 1, first to explain that Win98 is very weak for Unicode, so if you want to run Unicode compilation on Win98, it may cause an error or fail.

2. Since the kernel of Win2000 and later is written in Unicode, although it can run ANSI encoded programs, many places in the operation need to convert ANSI to Unicode, call Unicode version functions , Because the process of this conversion exists so ANSI's program running efficiency is not high. It is best to use Unicode written programs on Win2000.

4. Writing a common procedure 1, using the TCHAR data type when programming, this type can convert it to ANSI or Unicode based on the definition of the precompiled macro.

2, pre-compiled macro _mbcs, _unicode and unicode. _MBCS is a multi-byte and an ANSI string compile macro. At this point, TCHAR will be converted to Char. _Unicode and unicode are the precompiled macro encoded by Unicode, and TCHAR will be converted to Wchar_t.

3, _unicode and unicode and _mbCs cannot be defined simultaneously while compiling.

4, _unicode macro is used in the header file of the C run library, the Unicode macro is used for Windows header files. These two macros are generally defined.

V. Conversion Function 1, Unicode Convert to ANSI Use: MultibyToWideChar. 2, ANSI converted to Unicode: WideChartomultibyte.

转载请注明原文地址:https://www.9cbs.com/read-39202.html

New Post(0)