Problems with ã and õ in C++

Asked

Viewed 228 times

0

Guys, I’m having a problem with special characters in C++. I watched some videos about printing special characters on the console, until then ok I can print everything except ã and õ. After several attempts I realized that the same accents do not appear in cmd nor associating them to values of the ASCI table or even simply typing in the CMD. I use windows 8.1, I tried to translate for en but still ñ worked.

In the code I’ve already added

and call the function

setlocate(LC_ALL, "English");

But the console itself does not recognize it. In this case it only recognizes and does not. All other accents (á, é, í, ó, ù, â, ê, î, ô, ḍ, ç) function normally

The at the prompt appears as |=

1 answer

0

Boy, I don’t know if it’ll work for you but I’ve had similar problems, but mine was easy to solve, even using setlocale didn’t print properly, then later I discovered that in the sublime that is the text editor that I use to program I had to save the text in Western (Windows 1252) instead of UTF-8 ai when I compiled everything right.

there’s just for the record, you’re including the headers right?

#include <clocale> ou #include <locale.h> 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.