#include <qlgusr.h>
int QlgTransformUCSData(int xformtype, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft, size_t *outspacereg);Service Program: QLGUSR
The QlgTransformUCSData() function transforms, through a formula as compared to a mapping, data from one form of Unicode to another. A transformation type identification is used to specify the type of transformation.
1 | Transform from UCS-2 to UTF-8. |
2 | Transform from UTF-8 to UCS-2. |
Other transformation types are one of the following allowable values from the table of transformation types. The first three decimal digits represent the from encoding and the last three decimal digits represent the to encoding. For instance, 030042 is a transform from UTF-32 LE(Little Endian) (030) to UTF-16 BE(Big Endian) without a BOM(Byte Order Mark) (042).
Allowable decimal values:
010021, 010022, 010031, 010032, 010041, 010042, 010051, 010052, 010061, 010062, 020021, 020022, 020031, 020032, 020041, 020042, 020051, 020052, 020061, 020062, 030021, 030022, 030031, 030032, 030041, 030042, 030051, 030052, 030061, 030062, 040021, 040022, 040031, 040032, 040041, 040042, 040051, 040052, 040061, 040062, 050021, 050022, 050031, 050032, 050041, 050042, 050051, 050052, 050061, 050062, 060021, 060022, 060031, 060032, 060041, 060042, 060051, 060052, 060061, 060062
Table of transformation types:
Transformation | From: | To: with BOM | To: without BOM |
---|---|---|---|
Autodetect | 010 | ||
UTF-32 BE | 020 | 021 | 022 |
UTF-32 LE | 030 | 031 | 032 |
UTF-16 BE | 040 | 041 | 042 |
UTF-16 LE | 050 | 051 | 052 |
UTF-8 | 060 | 061 | 062 |
None
0 | QlgTransformUCSData() was successful. The entire 'inbuf' was transformed. |
BOMS | Hex values |
---|---|
UTF-32 BE (020) | 00 00 FE FF |
UTF-32 LE (030) | FF FE 00 00 |
UTF-16 BE (040) | FE FF |
UTF-16 LE (050) | FF FE |
UTF-8 (060) | EF BB BF |
A sample conversion:
transformation type: 030021
UTF-32 LE (030) -> UTF-32 BE marked (021)
x'AB 5F 00 00 7C 8E 00 00' -> x'00 00 FE FF 00 00 5F AB 00 00 8E 7C'
None.
Top | National Language Support APIs | APIs by category |