Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Display accented characters C/C++?

I wrote a program using printfs() of "é" or "à" compiling with MinGW 4.9.1, I was using
setlocale(LC_CTYPE, "fra");
to display these characters and it worked well

However when I compile the same program with MinGW 11.2 the accents are displayed this way : "é" "Ã"
I tried with setlocale(LC_ALL, ""); and it doesn’t work either

Does anyone have a solution?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

On Windows, you must explicitly set utf-8 as opposed to other platforms like Linux:

setlocale(LC_ALL, ".utf8")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading