PDA

View Full Version : Punctuation gives stange characters using cout



Wim1976
5th March 2014, 12:29
The following code gives a strange result on the screen with the character ë, also other punctuations gives unreadable output. What do I wrong?



#include <iostream>

using namespace std;

int main()
{
cout << "patiënt";

}

adutzu89
5th March 2014, 13:47
Are you using Qt Creator?

In Qt Creator 3.0.1, on Ubuntu 13.10 works fine for me.

Aditionally you can try other character types.

anda_skoa
5th March 2014, 17:00
You might not be doing anything wrong, but the two encodings might not match.

E.g. if your file encoding is UTF-8 and your console encoding is not, or vice versa.

Cheers,
_