1
Good afternoon,
I asked this question a while ago, but it was bad so I deleted it and I’m redoing it in more detail.
My problem is this: When I accentuate 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’s 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:
Is it? Is it? Is it"
Code::Blocks 16.01:
ÁÉÍÓÚ
I’ve tried to use setlocale
I tried to use the command chcp 850, 65001 and 1200 in this way: system("chcp xxx"
) where xxx is the code.
I changed the source to Lucida Consoles, also did not work.
I tried to change the source and executable to UTF-8 via command line with /source-charset:utf-8 /Execution-charset:utf-8 and it didn’t work.
There is an option to change the record but this is ridiculous. What’s more, Code::Blocks works smoothly, just adding setlocale
.
Additional information:
OS: Windows 10 Home
I’ve used in the setlocale
" ", "English", and more...
Any suggestions/ideas? Thank you.
Att;
I found the solution, I created an empty project and it worked, in addition to having fewer files like the stdafx.h header. I don’t know how to close the question, if anyone knows please feel free, thanks to everyone who has made their time available.
– uggorim