libUEMF
A portable library for reading and writing WMF, EMF and EMF+ files
|
Prototypes for functions that manipulate UTF and various types of text. More...
Go to the source code of this file.
Functions | |
void | wchar8show (const char *src) |
Dump a UTF8 string. Not for use in production code. More... | |
void | wchar16show (const uint16_t *src) |
Dump a UTF16 string. Not for use in production code. More... | |
void | wchar32show (const uint32_t *src) |
Dump a UTF32 string. Not for use in production code. | |
void | wchartshow (const wchar_t *src) |
Dump a wchar_t string. Not for use in production code. More... | |
size_t | wchar16len (const uint16_t *src) |
Find the number of (storage) characters in a 16 bit character string, not including terminator. More... | |
size_t | wchar32len (const uint32_t *src) |
Find the number of (storage) characters in a 32 bit character string, not including terminator. More... | |
void | wchar16strncpy (uint16_t *dst, const uint16_t *src, size_t nchars) |
Strncpy for wchar16 (UTF16). More... | |
void | wchar16strncpypad (uint16_t *dst, const uint16_t *src, size_t nchars) |
Fill the output string with N characters, if the input string is shorter than N, pad with nulls. More... | |
uint16_t * | U_Utf8ToUtf16le (const char *src, size_t max, size_t *len) |
Convert a UTF-8 string to a UTF16-LE string. More... | |
uint32_t * | U_Utf8ToUtf32le (const char *src, size_t max, size_t *len) |
Convert a UTF8 string to a UTF32LE string. More... | |
uint32_t * | U_Latin1ToUtf32le (const char *src, size_t max, size_t *len) |
Convert a Latin1 string to a UTF32LE string. More... | |
uint16_t * | U_Utf32leToUtf16le (const uint32_t *src, size_t max, size_t *len) |
Convert a UTF32LE string to a UTF16LE string. More... | |
char * | U_Utf32leToUtf8 (const uint32_t *src, size_t max, size_t *len) |
Convert a UTF32LE string to a UTF8 string. More... | |
uint32_t * | U_Utf16leToUtf32le (const uint16_t *src, size_t max, size_t *len) |
Convert a UTF16LE string to a UTF32LE string. More... | |
char * | U_Utf16leToUtf8 (const uint16_t *src, size_t max, size_t *len) |
Convert a UTF16LE string to a UTF8 string. More... | |
char * | U_Utf16leToLatin1 (const uint16_t *src, size_t max, size_t *len) |
Convert a UTF16LE string to a LATIN1 string. More... | |
char * | U_Utf8ToLatin1 (const char *src, size_t max, size_t *len) |
Convert a UTF8 string to a Latin1 string. More... | |
char * | U_Latin1ToUtf8 (const char *src, size_t max, size_t *len) |
Convert a Latin1 string to a UTF8 string. More... | |
uint16_t | U_Utf16le (const uint16_t src) |
Put a single 16 bit character into UTF-16LE form. More... | |
int | U_Utf16leEdit (uint16_t *src, uint16_t find, uint16_t replace) |
Single character replacement in a UTF-16LE string. More... | |
char * | U_strdup (const char *s) |
strdup for when strict C99 compliance is enforced More... | |
Prototypes for functions that manipulate UTF and various types of text.
uint32_t* U_Latin1ToUtf32le | ( | const char * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a Latin1 string to a UTF32LE string.
src | Latin1 string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
U_EMR_EXTTEXTOUTA records are "8 bit ASCII". In theory that is ASCII in an 8 bit character, but numerous applications store Latin1 in them, and some may store UTF-8 in them. Since very vew Latin1 strings are valid UTF-8 strings, call U_Utf8ToUtf32le first, and if it fails, then call this function.
char* U_Latin1ToUtf8 | ( | const char * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a Latin1 string to a UTF8 string.
src | Latin1 string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
WMF uses latin1, others UTF-8, all Latin1 should be able to convert to utf-8.
char* U_strdup | ( | const char * | s | ) |
strdup for when strict C99 compliance is enforced
s | string to duplicate |
uint16_t U_Utf16le | ( | const uint16_t | src | ) |
Put a single 16 bit character into UTF-16LE form.
Used in conjunction with U_Utf16leEdit(), because the character representation would otherwise be dependent on machine Endianness.
src | 16 bit character |
int U_Utf16leEdit | ( | uint16_t * | src, |
uint16_t | find, | ||
uint16_t | replace | ||
) |
Single character replacement in a UTF-16LE string.
Used solely for the Description field which contains embedded nulls, which makes it difficult to manipulate. Use some other character and then swap it.
src | UTF16LE string to edit |
find | character to replace |
replace | replacestitute character |
char* U_Utf16leToLatin1 | ( | const uint16_t * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF16LE string to a LATIN1 string.
src | UTF16LE string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
uint32_t* U_Utf16leToUtf32le | ( | const uint16_t * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF16LE string to a UTF32LE string.
src | UTF16LE string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
char* U_Utf16leToUtf8 | ( | const uint16_t * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF16LE string to a UTF8 string.
src | UTF16LE string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
uint16_t* U_Utf32leToUtf16le | ( | const uint32_t * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF32LE string to a UTF16LE string.
src | wchar_t string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
char* U_Utf32leToUtf8 | ( | const uint32_t * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF32LE string to a UTF8 string.
src | wchar_t string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
char* U_Utf8ToLatin1 | ( | const char * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF8 string to a Latin1 string.
src | Latin1 string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
WMF uses latin1, others UTF-8, only some utf-8 can be converted to latin1.
uint16_t* U_Utf8ToUtf16le | ( | const char * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF-8 string to a UTF16-LE string.
src | UTF8 string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
uint32_t* U_Utf8ToUtf32le | ( | const char * | src, |
size_t | max, | ||
size_t * | len | ||
) |
Convert a UTF8 string to a UTF32LE string.
src | UTF8 string to convert |
max | number of characters to convert, if 0, until terminator |
len | number of characters in new string, NOT including terminator |
size_t wchar16len | ( | const uint16_t * | src | ) |
Find the number of (storage) characters in a 16 bit character string, not including terminator.
src | string to examine |
void wchar16show | ( | const uint16_t * | src | ) |
Dump a UTF16 string. Not for use in production code.
src | string to examine |
void wchar16strncpy | ( | uint16_t * | dst, |
const uint16_t * | src, | ||
size_t | nchars | ||
) |
Strncpy for wchar16 (UTF16).
dst | destination (already allocated) |
src | source |
nchars | number of characters to copy |
void wchar16strncpypad | ( | uint16_t * | dst, |
const uint16_t * | src, | ||
size_t | nchars | ||
) |
Fill the output string with N characters, if the input string is shorter than N, pad with nulls.
dst | destination (already allocated) |
src | source |
nchars | number of characters to copy |
size_t wchar32len | ( | const uint32_t * | src | ) |
Find the number of (storage) characters in a 32 bit character string, not including terminator.
src | string to examine |
void wchar8show | ( | const char * | src | ) |
Dump a UTF8 string. Not for use in production code.
src | string to examine |
void wchartshow | ( | const wchar_t * | src | ) |
Dump a wchar_t string. Not for use in production code.
src | string to examine |