Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print UTF-8 characters on console using C

I have a C application where I receive a UTF-8 string aover a socket as a char*. Now I want to print it on the console using Eclipse CDT. How can I do this? What I get is usually something like "Günther" what should be "Günther"

Thanks a lot.

like image 230
AlexLiesenfeld Avatar asked Nov 03 '22 04:11

AlexLiesenfeld


1 Answers

The best answer given above was by Joachim Isaksson. Thank you, this ideed seems to be the problem. I solved it in Eclipse by setting the "Encoding" settings for the run configuration to UTF-8.

enter image description hereenter image description here

like image 120
AlexLiesenfeld Avatar answered Nov 09 '22 09:11

AlexLiesenfeld