Reputation: 292
I'm sending an user-generated string from my program into a C++ DLL function I'm making. It works fine, until I send a string like "åäö". My function looks something like this:
export void showMessage(char* str) {
MessageBox(NULL, str, "DLL says", MB_OK);
}
When "åäö" is sent from the program, a message with "åäö" popups up. How do I convert it into "åäö"? What library is needed? I'm using Code::Blocks for the DLL.
Upvotes: 0
Views: 430
Reputation: 19333
The characters you are using appear to be in the extended ASCII table (value greater than 127), and will depend on the code page you are using, which is a less than portable approach, since the system running your code needs to make environment changes outside of the program itself.
Instead of using MessageBox
, use the Unicode enabled version, MessageBoxW
, and look up the Unicode encodings for the characters you specified.
References
<http://zone.ni.com/reference/en-XX/help/371361J-01/lvexcodeconcepts/unicode_ansi_version_functs/>
<http://www.theasciicode.com.ar/extended-ascii-code/capital-letter-a-ring-uppercase-ascii-code-143.html>
<http://unicodelookup.com/>
Upvotes: 2