If you can create a wide-character string literal, just throwing L should provide you with a multi-byte character string literal with a specific implementation encoding (gcc has the ability to select it, I don't know about visual C ++).
If you have a wide character string, you can get the equivalent multibyte string according to the C locale using the functions wcstombs (in <stdlib.h> ) and wcsrtombs (in <wchar.h> ).
The C ++ language system also provides a way to do this conversion. (Look for the in and out member of the codecvt facet, I will not provide a tutorial on how to use them here, the cppreference site has code examples, for example, for out ).
I'm not sure if you can easily find support on Unix or Windows for shift coding. You should look for encoding for China, Japan, Korea, Vietnam (for example, ISO 2022-JP , but it seems to me that Unix, as a rule, uses EUC-JP and Windows Shift JIS ).
source share