![]() |
Lucciefr
Lua code caving, injection and exploration framework
|
Windows codepage / character (set) conversions. More...
Functions | |
| int | wide_to_str (char **output, const UINT codepage, const wchar_t *wstr, int wlen) |
| "wide to string". More... | |
| int | str_to_wide (wchar_t **output, const UINT codepage, const char *str, int len) |
| "string to wide". More... | |
| int | str_to_str (char **output, const UINT codepage_from, const UINT codepage_to, const char *str, int len) |
| "string to string" Convert a "multibyte" string between given codepages. More... | |
Windows codepage / character (set) conversions.
CP_* constants can also be found/included via <winnls.h>. | int str_to_str | ( | char ** | output, |
| const UINT | codepage_from, | ||
| const UINT | codepage_to, | ||
| const char * | str, | ||
| int | len | ||
| ) |
"string to string" Convert a "multibyte" string between given codepages.
You could e.g. use this to translate between ANSI and UTF-8. output receives the (char*) result allocated with malloc, make sure you free() it later!
*output | int str_to_wide | ( | wchar_t ** | output, |
| const UINT | codepage, | ||
| const char * | str, | ||
| int | len | ||
| ) |
"string to wide".
Convert a "multibyte" string from given codepage to a wide (UTF-16) string. You can use this to translate from UTF-8 with codepage == CP_UTF8. Pass codepage == 0 (or CP_ACP) to use the default "ansi" codepage of the system. output receives the (wchar_t*) result allocated with malloc, make sure you free() it later!
*output | int wide_to_str | ( | char ** | output, |
| const UINT | codepage, | ||
| const wchar_t * | wstr, | ||
| int | wlen | ||
| ) |
"wide to string".
Convert a wide (UTF-16) string to a "multibyte" string with a given codepage. You can use this to translate to UTF-8 with codepage == CP_UTF8. Pass codepage == 0 (or CP_ACP) to use the default "ansi" codepage of the system. output receives the (char*) result allocated with malloc, make sure you free() it later!
*output
1.8.10