![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <StrU.h>
Public Types | |
enum | UTFLead_TYPE { UTFLead_0 = 0xefU , UTFLead_1 = 0xbbU , UTFLead_2 = 0xbfU , UTFLead_X = 0xbeU } |
Static Public Member Functions | |
static bool __stdcall | IsUTFLead (const void *pvU) |
static StrLen_t __stdcall | UTF8Size (wchar_t wChar, int &riStartBits) |
static StrLen_t __stdcall | UTF8Size1 (unsigned char chFirst, int &riStartBits) |
static StrLen_t __stdcall | UTF8Size (const char *pInp, StrLen_t iSizeInpBytes, int &riStartBits) |
static StrLen_t __stdcall | UTF8toUNICODE (wchar_t &wChar, const char *pInp, StrLen_t iSizeInpBytes) |
static StrLen_t __stdcall | UNICODEtoUTF8 (char *pOut, StrLen_t iSizeOutMaxBytes, wchar_t wChar) |
static StrLen_t __stdcall | UTF8toUNICODELen (const char *pInp, StrLen_t iSizeInpBytes=k_StrLen_UNK) |
static StrLen_t __stdcall | UNICODEtoUTF8Size (const wchar_t *pInp, StrLen_t iSizeInpChars=k_StrLen_UNK) |
static StrLen_t __stdcall | UTF8toUNICODE (OUT wchar_t *pOut, StrLen_t iSizeOutMaxChars, const char *pInp, StrLen_t iSizeInpBytes=k_StrLen_UNK) |
static StrLen_t __stdcall | UNICODEtoUTF8 (OUT char *pOut, StrLen_t iSizeOutMaxBytes, const wchar_t *pInp, StrLen_t iSizeInpChars=k_StrLen_UNK) |
Static Public Attributes | |
static const StrLen_t | k_UTF8_SIZE_MAX = 4 |
Max of 4 BYTEs to encode any UNICODE char. More... | |
Friends | |
class | StrUTests |
A bunch of functions for UNICODE strings and UTF8. Might be named StrW ? Opposite of StrA.
http://www.unicode.org/faq/utf_bom.html Invalid UTF8 sequences are used for special meaning by M$. Placed at start of text file to indicate encoding. ef bb bf (M$ "lead bytes") ef bf be ef bf bf
Enumerator | |
---|---|
UTFLead_0 | |
UTFLead_1 | |
UTFLead_2 | |
UTFLead_X |
Skip the stupid Microsoft UTF-8 Byte order marks that are put at the start of a file.
|
static |
Convert a single UNICODE char to UTF8 encoded char (maybe using multi chars).
bytes bits representation: 1 7 0bbbbbbb 2 11 110bbbbb 10bbbbbb 3 16 1110bbbb 10bbbbbb 10bbbbbb 4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
|
static |
Copy CODEPAGE_t CP_UTF8 to UNICODE. similar to _WIN32 ::WideCharToMultiByte().
|
static |
How many UTF8 bytes to store this UNICODE string ?
|
static |
How much UTF8 data do i need to make the UNICODE char?
How big would this UNICODE char be as UTF8?
How many more bytes in this UTF8 sequence? estimated from the first byte of a UTF sequence.
|
static |
Convert the CODEPAGE_t CP_UTF8 default text format to UNICODE May be network byte order! Adds null. similar to _WIN32 ::MultiByteToWideChar().
|
static |
Convert a single UTF8 encoded character (multi chars) to a single UNICODE char.
Bytes bits representation: 1 7 0bbbbbbb 2 11 110bbbbb 10bbbbbb 3 16 1110bbbb 10bbbbbb 10bbbbbb 4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
|
static |
How many UNICODE chars to store this UTF8 string ?
|
friend |
|
static |
Max of 4 BYTEs to encode any UNICODE char.