Read swedish characters from textfile to array and display correctly

Hi!

Im currently using this but of code to put lines from a textfile into an string array.

 dataLines = dataFile.text.Split('\n');

It works as intended but then i use this code to display the text in an Text

 questionText.text = dataLines[fraga];

The problem here is that it doesnt display the swedish characters ÖÄÅ correctly and just skips them.

Anyone know how to fix this or perhaps if theres a better way to do this?

It will probably be because of the font, if the font does not support said characters, it simply cannot display them. Try using a font which support those characters and update me if it works or not.

Its not the font, my app have no problems displaying “äöå” if i type them direcly, its when its converting from the textfile to the array the “äåö” letters disapear,

I’d agree with the above reply but if that doesn’t work I’d also make sure your text file is in UTF-8 format too. (you can set this in Uniscite or programs like notepad2 under File->encoding)

This post:
https://stackoverflow.com/questions/8089357/how-to-read-special-character-like-é-â-and-others-in-c-sharp
Suggests it is to do with the encoding.

I just noticed something perhaps this will help.

In the inspector all the "åäö"s are gone, but when im in my editor in visual studio they are still there.

Why does this happen?