There is a C++ program that I need to add the ability to read a file. I found that it isn't working for European special characters. The example I'm working with are Swedish characters.
I changed the code to use wide characters, but that doesn't seem to have helped.
The sample text file that I'm reading has the following content:
"NEW-DATA"="Nysted Vi prøver lige igen"
This is on Windows and Nodepad says that this file is using UTF-8 encoding.
In Visual Studio, when debugging, the string that is read is being displayed as if the string is in ASCII:
"NEW-DATA"="Nysted Vi prøver lige igen"
I changed the code to use the "wide" methods:
std::wifstream infile;
infile.open(argv[3], std::wifstream::in);
if (infile.is_open())
{
std::wstring line;
while (std::getline(infile, line))
{
....
Is there something else I need to do to get it to correctly recognize UTF-8?