Author Topic: German umlauts in MessageBox  (Read 16167 times)

Offline Newling

  • Multiple posting newcomer
  • *
  • Posts: 17
German umlauts in MessageBox
« on: November 04, 2013, 07:55:02 pm »
When I create a messagebox and the program will start, the german umlauts are not displayed correctly on the messagebox.

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

The result is:
Code
---------------------------
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!


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: German umlauts in MessageBox
« Reply #1 on: November 05, 2013, 12:16:15 am »
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

Offline Newling

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: German umlauts in MessageBox
« Reply #2 on: November 05, 2013, 06:44:18 am »
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  :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: German umlauts in MessageBox
« Reply #3 on: November 05, 2013, 06:55:37 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: German umlauts in MessageBox
« Reply #4 on: November 05, 2013, 08:23:12 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!]

Offline Newling

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: German umlauts in MessageBox
« Reply #5 on: November 05, 2013, 09:27:14 am »
The build log is:
Code
-------------- 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:
Code
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

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



Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: German umlauts in MessageBox
« Reply #6 on: November 05, 2013, 10:11:10 am »
sry, i think it was to late last night...

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

Offline Newling

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: German umlauts in MessageBox
« Reply #7 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: German umlauts in MessageBox
« Reply #8 on: November 06, 2013, 09:48:41 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 !

Offline Newling

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: German umlauts in MessageBox
« Reply #9 on: November 06, 2013, 06:14:41 pm »
Yes, it was a setting issue.