Code::Blocks Forums

User forums => Help => Topic started by: PeterP on March 26, 2010, 06:59:47 pm

Title: (solved) wchar_t problem
Post by: PeterP on March 26, 2010, 06:59:47 pm
hi,
I just installed the official release (with included mingw compiler).
I wanted ro use a library that uses wchar_t strings alot.
but when I try to use special characters like umlauts (äöüßÄÖÜ) like this:
Code
wchar_t wc = L'ä'; // example with single character
I get an error message sying: "converting to execution character set: Invalid argument"

I know I can use escape sequences, but it's hard to read in the source code and I also have to search for the correct hex value for the characters every time what's pretty boring... :(

with normal (char) strings I have no problem, I can enter this characters directly...
so now I'm wondering if I'm something missing to get this chars to work like with normal char strings ???  :shock:

thank you,
Peter
Title: Re: wchar_t problem
Post by: koso on March 26, 2010, 07:44:51 pm
Try to use compiler switch "-finput-charset=<source charset>" in build options. More information about switch -> google :)
Title: Re: wchar_t problem
Post by: PeterP on March 26, 2010, 08:15:06 pm
hahaha, I knew I was missing something !!!  :D
I used -finput-charset=iso-8859-1 and it works now !!!

thank you, very much !!! ;)