115#ifndef __mlConvertUTF_H
116#define __mlConvertUTF_H
135#define UNI_REPLACEMENT_CHAR (static_cast<UTF32>(0x0000FFFD))
136#define UNI_MAX_BMP (static_cast<UTF32>(0x0000FFFF))
137#define UNI_MAX_UTF16 (static_cast<UTF32>(0x0010FFFF))
138#define UNI_MAX_UTF32 (static_cast<UTF32>(0x7FFFFFFF))
245 unsigned int *length,
255 unsigned int *length,
ConversionResult ConvertUTF32toUTF16(const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
Converts UTF32 string to UTF16 string.
MLuint16 UTF16
at least 16 bits
ConversionFlags
Enum to describe conversion strictness.
@ strictConversion
Strict conversion, error on conversion problem.
@ lenientConversion
Non-strict conversion, use '?' or UNI_REPLACEMENT_CHAR instead.
ConversionResult ConvertUTF8toLatin1(const UTF8 *sourceStart, char *targetStart, char *targetEnd, ConversionFlags flags)
Convert UTF8 to latin1 chars.
ConversionResult ConvertUTF8toUTF16(const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
Converts UTF8 string to UTF16 string.
ConversionResult CalculateNumCharsInUTF8(const UTF8 *sourceStart, unsigned int *length, ConversionFlags flags)
Calculate the number of chars in an UTF8 string (may be less than strlen, because of multibyte encode...
MLuint8 UTF8
typically 8 bits
ConversionResult ConvertUTF8toUTF32(const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd)
Converts UTF8 string to UTF32 string.
ConversionResult CalculateUTF16BufferSizeForUTF8(const UTF8 *sourceStart, unsigned int *length, ConversionFlags flags)
Calculate the number of chars required in UTF16 encoding to fit the given UTF8 string (may be less th...
ConversionResult ConvertUTF16toUTF8(const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
Converts UTF16 string to UTF8 string.
MLuint32 UTF32
Note : This file has been adapted to the purpose of ML and MeVisLab usage.
ConversionResult ConvertUTF32toUTF8(const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
Converts UTF32 string to UTF8 string.
ConversionResult ConvertUTF16toUTF32(const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
Converts UTF16 string to UTF32 string.
ConversionResult
Enum to describe conversion results.
@ targetExhausted
insuff. room in target for conversion
@ sourceIllegal
source sequence is illegal/malformed
@ conversionOK
conversion successful
@ sourceExhausted
partial character in source, but hit end
Target mlrange_cast(Source arg)
Generic version of checked ML casts.