PB10 character operation

xiaoxiao2021-03-05  32

The PB starts from version 10 to support Unicode by internal integration. This allows PB10 to process data on different language platforms, and can also display multiple languages ​​on the same interface.

Let's learn about learning related nouns:

ANSI: ANSI is also a character between the ASCII value of 0-255. When the character is ANSI, it is a byte that is stored in the file. If it is non-ANSI, it takes up two bytes.

DBCS: It is the abbreviation of Double Byte Char Systems, namely the two-word character set, which is the character set in Asia, fully encompassing ANSI.

SBCS: It is the abbreviation of Single Byte Char Systems, namely single-byte character set, tolerant ANSI.

UTF8: Variable length Unicode encoding, minimum one byte, one Chinese character occupies three bytes.

UTF16LE: Double-byte Unicode encoding, Unicode hidosus method byte-endian, example FF Fe (byte order flag BOM) 41 00 42 00 4300. Bom is an abbreviation for Byte-Order Mark.

UTF16BE: Double-byte Unicode encoding, Unicode Madi-byte Sequence (BIG-Endian), Example FE FF (byte Sequence Sign BOM) 00 41 00 42 00 43.

Specific changes include: 1. The source code in PowerBuilder 10 PBLS is all UTF-16LE encoding, and the previous version is an ANSI code. 2, the text entered in the PB10 application automatically transforms to the Unicode format, String and the Character data type only store the Unicode data format, and increase or change some string operation functions. 3. Some functions involving the file operation have been modified. 4. The declaration of external functions has been changed. 5. Import export files can be selected. 6, PBNI, XML, Web Services, etc. Unicode support.

The impact on previous procedures: 1. In the DBCS environment, it is necessary to change the format of the corresponding * A before the DBCS environment, 2, the structure in an API has a Char array. Because this API function is required by the ANSI format, only the Unicode format is stored in the PB10, and if using CHAR A [N] = "Chinese characters", the result will be garbled.

Finally, I took this more trouble method to deal with:

String a = "Chinese characters" for i = 1 to lena (a) lpdata.szinfotitle [i] = MIDA (A, i) Next

I don't know if there is any good way, this approach is for your reference.

Other influences I have not encountered temporarily, welcome everyone to supplement. :)

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

New Post(0)