Good afternoon,
I asked this question a long time ago, but it was bad so I deleted it and I'm redoing it in more detail.
My problem is this: When I use accent in Visual Studio it returns strange characters. This only happens when I compile using Visual Studio, when I use Code :: Blocks the output is normal.
Here is the code:
#include "stdafx.h" //essa linha somente no Visual Studio
#include <iostream>
#include <cstdlib>
#include <clocale>
using namespace std;
int main()
{
setlocale(LC_ALL, "Portuguese");
cout << "ÁÉÍÓÚ" << endl;
system("pause");
return 0;
}
Here are the exits:
Visual Studio 2017:
à à à à à à Ã
Code :: Blocks 16.01:
AIOUS
I have tried to use setlocale
I tried to use the chcp 850, 65001 and 1200 command like this: system("chcp xxx"
) where xxx is the code.
I changed the font to Lucida Consoles, it also did not work.
I tried to change the source and the executable to UTF-8 via command line with / source-charset: utf-8 / execution-charset: utf-8 and did not work.
You have an option to change the registry but this is ridiculous. What's more, Code :: Blocks works quietly, just by adding setlocale
.
Additional information:
OS: Windows 10 Home
I've already used it in setlocale
"", "English", and more ...
Any suggestions / ideas? Thank you.
Att;