Need help with Dev C++ Unicode

Apr 4, 2014 at 10:05am
Hello,
first of all i'm an absolute beginner. And also sorry for my bad english.

I'm trying to output some unicoe letters.
In this case "ü" and "Ö". But when I compile and run it shows other symbols.
What am I doing wrong?

I'm using TMD-GCC vers. 4.8.1 64 bit

1
2
3
4
5
6
#include <iostream>
using namespace std;
int main () {
	cout << "\u00FC \u00D8" << endl;
	return 0;
}
Apr 4, 2014 at 10:22am
The problem is that cout doesn't know anything about unicode.

Try wcout:

wcout << L"üÖ" << endl; // Note: L -> wide string

whether this works or not depends on the console.
Apr 4, 2014 at 10:34am
I tried,
but now it shows: [Error] converting to execution character set: Invalid argument
Apr 4, 2014 at 10:36am
I think (based on my own test your computer might have a different table)
that your numbers are wrong
ü:0081
however cout<<"\u0081" gave me an error however cout << "\u00FC" didn't but gave me a wrong character (a superscript n ⁿ or using the format tags n)
in that case Ö:99

to correct the error I used
wcout<<wchar(0x0081)<<endl;
Last edited on Apr 4, 2014 at 10:37am
Apr 4, 2014 at 11:12am
How do I get the right numbers?

Using cout<<"\u0081" I'm getting an synchronize charakter followed by ü.

If I try wcout<<wchar(0x0081)<<endl; I get:[Error] 'wchar' was not declared in this scope.

Topic archived. No new replies allowed.