I have string input. I want to check all the characters and prompt the user if there is any Unicode character in input string.
How can I do this validation in C++.
eg. In Notepad if you enter any Unicode character and try to save it with ANSI Encoding, it will prompt about Unicode character. I want to do similar validation.
What Notepad warns you about is slightly different: It warns you about Unicode characters that cannot be converted to the desired code page. IOW, WideCharToMultiByte(CP_ACP, ..., &lpUsedDefaultChar)
causes lpUsedDefaultChar
to be set to TRUE.
Substitute CP_ACP
for the encoding you want, except CP_UTF8
which makes no sense. UTF8 supports all Unicode characters.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments