Functions |
| bool | common::ConvertUnicodeToChars (string *Out, const wstring &S, unsigned CodePage) |
| bool | common::ConvertUnicodeToChars (string *Out, const wchar_t *S, unsigned NumChars, unsigned CodePage) |
| bool | common::ConvertCharsToUnicode (wstring *Out, const string &S, unsigned CodePage) |
| bool | common::ConvertCharsToUnicode (wstring *Out, const char *S, unsigned NumChars, unsigned CodePage) |
| bool | common::UnicodeToChars_CalcBufLen (size_t &outLen, const wchar_t *wcs, unsigned CodePage) |
| | Oblicza liczbę znaków (nie bajtów!) potrzebną przy konwersji między Unicode i ANSI.
|
| bool | common::UnicodeToChars_CalcBufLen (size_t &outLen, const wchar_t *wcs, size_t wcsLen, unsigned CodePage) |
| bool | common::CharsToUnicode_CalcBufLen (size_t &outLen, const char *str, unsigned CodePage) |
| bool | common::CharsToUnicode_CalcBufLen (size_t &outLen, const char *str, size_t strLen, unsigned CodePage) |
| bool | common::ConvertUnicodeToChars (char *outBuf, size_t bufLen, const wchar_t *wcs, unsigned CodePage) |
| | Konwertuje łańcuch między Unicode i ANSI. Nie dołącza kończącego zera.
|
| bool | common::ConvertUnicodeToChars (char *outBuf, size_t bufLen, const wchar_t *wcs, size_t wcsLen, unsigned CodePage) |
| bool | common::ConvertCharsToUnicode (wchar_t *outBuf, size_t bufLen, const char *str, unsigned CodePage) |
| bool | common::ConvertCharsToUnicode (wchar_t *outBuf, size_t bufLen, const char *str, size_t strLen, unsigned CodePage) |
Detailed Description
Konwersje między łańcuchem Unicode (UTF-16) a łańcuchem w innym kodowaniu - Single Byte lub Multi Byte.
CodePage to kodowanie znaków typu char. Przykładowe wartości:
- Stałe: CP_UTF8 (UTF-8), CP_ACP (natywna, 1-bajtowa strona kodowa systemu).
- Numery takie jak 1250 dla kodowania Windows-1250 (p. MSDN > "Code Page Identifiers").
Funkcje zwracają false w przypadku niepowodzenia konwersji. Wówczas Out jest pusty.
Function Documentation
| bool common::CharsToUnicode_CalcBufLen |
( |
size_t & |
outLen, |
|
|
const char * |
str, |
|
|
size_t |
strLen, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::CharsToUnicode_CalcBufLen |
( |
size_t & |
outLen, |
|
|
const char * |
str, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertCharsToUnicode |
( |
wchar_t * |
outBuf, |
|
|
size_t |
bufLen, |
|
|
const char * |
str, |
|
|
size_t |
strLen, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertCharsToUnicode |
( |
wchar_t * |
outBuf, |
|
|
size_t |
bufLen, |
|
|
const char * |
str, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertCharsToUnicode |
( |
wstring * |
Out, |
|
|
const char * |
S, |
|
|
unsigned |
NumChars, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertCharsToUnicode |
( |
wstring * |
Out, |
|
|
const string & |
S, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertUnicodeToChars |
( |
char * |
outBuf, |
|
|
size_t |
bufLen, |
|
|
const wchar_t * |
wcs, |
|
|
size_t |
wcsLen, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertUnicodeToChars |
( |
char * |
outBuf, |
|
|
size_t |
bufLen, |
|
|
const wchar_t * |
wcs, |
|
|
unsigned |
CodePage | |
|
) |
| | |
Konwertuje łańcuch między Unicode i ANSI. Nie dołącza kończącego zera.
Błąd: zwraca false, outBuf ustawia na łańcuch pusty.
| bool common::ConvertUnicodeToChars |
( |
string * |
Out, |
|
|
const wchar_t * |
S, |
|
|
unsigned |
NumChars, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::ConvertUnicodeToChars |
( |
string * |
Out, |
|
|
const wstring & |
S, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::UnicodeToChars_CalcBufLen |
( |
size_t & |
outLen, |
|
|
const wchar_t * |
wcs, |
|
|
size_t |
wcsLen, |
|
|
unsigned |
CodePage | |
|
) |
| | |
| bool common::UnicodeToChars_CalcBufLen |
( |
size_t & |
outLen, |
|
|
const wchar_t * |
wcs, |
|
|
unsigned |
CodePage | |
|
) |
| | |
Oblicza liczbę znaków (nie bajtów!) potrzebną przy konwersji między Unicode i ANSI.
Błąd: Zwraca false, outLen ustawia na 0.