Loading data from File using TextAsset. Unable to output ÖÄÅ chars,Loading data from File using TextAsset, but unable ouput ÖÄÅ chars to UI.text
So everything works fine except all the öäå chars are boxses/random symbols. How dod I fix this?
here is my file that loads data from text file: public TextAsset file; private string text;
// Start is called before the first frame update
void Awake()
{
text = file.text;
if (text == "")
text = System.Text.Encoding.Default.GetString(file.bytes);
Config.QA = convertToQuestions();
}
Question[] convertToQuestions()
{
string[] line = text.Split(new String[] { "\n" }, StringSplitOptions.None);
Question[] new_QA = new Question[line.Length];
for (int i = 0; i < line.Length; i++)
{
string[] splitQA = line[i].Split(new String[] { "\t" }, StringSplitOptions.None);
new_QA[i] = new Question(splitQA[0], Convert.ToBoolean(splitQA[1]));
}
return new_QA;
}
Comment
Your answer
Follow this Question
Related Questions
How to load my text file 1 Answer
Best Practice For Storing RPG Dialogue? 1 Answer
Is it possible to call a variable (i.e. int) from a text variable ? 0 Answers
Making texts look smooth good and not pixel crisp no matter their size with TMP & custom fonts 0 Answers
Convert UI Text into string? 1 Answer