News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

German umlauts in MessageBox

Started by Newling, November 04, 2013, 07:55:02 PM

Previous topic - Next topic

Newling

When I create a messagebox and the program will start, the german umlauts are not displayed correctly on the messagebox.

MessageBox(hwndDlg, "äöüÄÖÜ?", "MessageBox", MB_OK);

The result is:
---------------------------
MessageBox
---------------------------
äöüÃ,,ÖÜ?
---------------------------
OK   
---------------------------

The source code is ASCII characters, encoding when opening File is 'ISO-8859-1',
the compileroption '-finput-charset=iso-8859-1' is includiert.

What could still be wrong?

C::B  svn9425
gcc   4.7.1
OS    XP-SP3
Lang  C


Thanks for any help!


BlueHazzard

1) this is not a general programming forum, so this is OT and a admin will probably lock it
2) Umlauts are unicode and so can't be passed as normal strings in wxWidgets because it uses UTF-16 unless you say you wan't use UTF-8
3) I would ask this question in the wxWidgets forums, because this is a wxWidgets topic...

greetings and good night

Newling

1)This is not a general question about programming, but a question of the behavior of C :: B.
2)Umlauts are not generally Unicode, the umlauts in the main.cpp is ASCII code.
3)I do not use wxWidgets, the program is written in C.

greetings and good morning  :)

stahta01

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Post the Full Build log here and on a site that supports your Compiler; maybe someone will see a problem.

If you really think it is a Code::Blocks bug; please follow this template on reporting the issue.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

I think it is likely a Compiler issue; but, it might be a CB setting issue.

NOTE: CB is an IDE it is NOT a compiler! This site does NOT support any compiler or learning/fixing C programs.

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Quote from: Newling on November 05, 2013, 06:44:18 AM
3)I do not use wxWidgets, the program is written in C.
Compile from the command line and see if it works. If it does then it is C::B problem, else it is a compiler/setup problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Newling

The build log is:
-------------- Erstellen: Release in test1 (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -O2 -O1 -finput-charset=iso-8859-1  -c "C:\Dokumente und Einstellungen\User\Desktop\test1\main.cpp" -o obj\Release\main.o
c++.exe  -o bin\Release\test1.exe obj\Release\main.o  obj\Release\resource.res -s  -lgdi32 -luser32 -lkernel32 -mwindows
Output file is bin\Release\test1.exe with size 10,00 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


When I run the three lines in the console I get the exe with the same error:
g++.exe -Wall -O2 -O1 -finput-charset=iso-8859-1  -c "C:\Dokumente und Einstellungen\User\Desktop\test1\main.cpp" -o obj\Release\main.o
windres.exe  -J rc -O coff -i C:\DOKUME~1\User\Desktop\test1\resource.rc -o obj\Release\resource.res
c++.exe  -o bin\Release\test1.exe obj\Release\main.o  obj\Release\resource.res -s  -lgdi32 -luser32 -lkernel32 -mwindows


"äöüÄÖÜ?ß" => "äöüÃ,,ÖÜ?ß"



BlueHazzard

sry, i think it was to late last night...

I would try L"äöü" and use unicode not aschii...

Newling

Thanks for your help!

The reason was that in
Settings->Compiler->Other Optptions
the entry -finput-charset=iso-8859-1 was included.


Now it seems to work.

Jenna

Quote from: Newling on November 06, 2013, 08:02:16 AM
Thanks for your help!

The reason was that in
Settings->Compiler->Other Optptions
the entry -finput-charset=iso-8859-1 was included.


Now it seems to work.
So it turns out to be a user (configuration) error and not a Code::Blocks error !

Newling