How to read Polish (latin-extended-a) characters from a file?
I'm trying to read text from file and Debug.Log()
it to the console. My reading script looks like this:
string fileText = File.ReadAllText(filePath,System.Text.Encoding.Default);
(I also tried Encoding.UTF8
and using StreamRenderer)
When I try to Debug.Log(fileText)
what I see is:
While it should be:Witaj podr�niku! - powidzia�a gospodyni z za lady
Witaj podróżniku! - powidziała gospodyni z za lady
Debug.Log("- Witaj podróniku! - powidziała gospodyni z za lady");
works just fine so the problem probably lies in reading the file, but I just can't figure out what am I doing wrong. This is a .csv file, but I did try with .txt - same result. What can I do to make this script read extended latin properly?
Thanks in advance.
Answer by tyren234 · May 04 at 06:43 AM
For anyone who stumbles upon this question in the future - I found the answer. It turnes out that Unity Editor doesn't work for some reason and it simply can't comprehend Polish characters read from file, but builded game works just fine :).
The lesson is - build your game before posting a question. Have a great day everyone