How do you read a ANSI encoded files and use it with wxString?
Posted: Mon May 11, 2020 2:14 pm
So, I've been searching for the way to do it and I just can't find it. I'm sure I am missing something trivial.
I'm reading a binary a file where characters are encoded in ANSI (8 bit characters). I want to show their content in a wxString.
For exemple, I read the letter "é":
- fread gives me a char, the letter "é" value is -63 because it is an signed type.
- I cannot use this character directly inside a wxString, it is not valid because it is a character encoded on 8 bit. wxString is empty.
Is there a simple way to do it? Do I need to convert all the time to an of wchar_t first than use that instead?
I'd like to know how you people manage this.
Thx again, sorry if I'm missing something trivial.
I'm reading a binary a file where characters are encoded in ANSI (8 bit characters). I want to show their content in a wxString.
For exemple, I read the letter "é":
- fread gives me a char, the letter "é" value is -63 because it is an signed type.
- I cannot use this character directly inside a wxString, it is not valid because it is a character encoded on 8 bit. wxString is empty.
Is there a simple way to do it? Do I need to convert all the time to an of wchar_t first than use that instead?
I'd like to know how you people manage this.
Thx again, sorry if I'm missing something trivial.