G
Guest
Hello everyone,
Wide character and multi-byte character are two popular encoding schemes on
Windows. And wide character is using unicode encoding scheme. But each time I
feel confused when talking with another team -- codepage -- at the same time.
I am more confused when I saw sometimes we need codepage parameter for wide
character conversion, and sometimes we do not need for conversion. Here are
two examples,
code page is used in WideCharToMultiByte when dealing with unciode character
int WideCharToMultiByte (
UINT CodePage,
DWORD dwFlags,
LPCWSTR lpWideCharStr,
int cchWideChar,
LPSTR lpMultiByteStr,
int cbMultiByte,
LPCSTR lpDefaultChar,
LPBOOL lpUsedDefaultChar );
code page is not used in wcstombs when dealing with unciode character
size_t wcstombs (
char* mbstr,
const wchar_t* wcstr,
size_t count );
My question is, what is codepage (seems my current understanding is not
correct)? Does codepage have anything to do with multi-byte character or only
have relationship with wide character? Could anyone explain the meaning and
relationship between codepage, wide character and multi-byte character?
thanks in advance,
George
Wide character and multi-byte character are two popular encoding schemes on
Windows. And wide character is using unicode encoding scheme. But each time I
feel confused when talking with another team -- codepage -- at the same time.
I am more confused when I saw sometimes we need codepage parameter for wide
character conversion, and sometimes we do not need for conversion. Here are
two examples,
code page is used in WideCharToMultiByte when dealing with unciode character
int WideCharToMultiByte (
UINT CodePage,
DWORD dwFlags,
LPCWSTR lpWideCharStr,
int cchWideChar,
LPSTR lpMultiByteStr,
int cbMultiByte,
LPCSTR lpDefaultChar,
LPBOOL lpUsedDefaultChar );
code page is not used in wcstombs when dealing with unciode character
size_t wcstombs (
char* mbstr,
const wchar_t* wcstr,
size_t count );
My question is, what is codepage (seems my current understanding is not
correct)? Does codepage have anything to do with multi-byte character or only
have relationship with wide character? Could anyone explain the meaning and
relationship between codepage, wide character and multi-byte character?
thanks in advance,
George