I have this simple line:
TextAsset lngr = (TextAsset) Resources.Load(“Text\info”);
It works fine except for the fact that Spanish characters like “ñ” or “á” are skipped, for example; the file contains the word “Capítulo” but it is loaded as “Captulo”, is this a bug? or am I missing something?
At first I thought it was a font’s problem, but when I debugged the code I realized it was caused by Resources.Load
I’m using Unity 5.3.4 personal edition.
After several attempts I finally found a work around, hope someone can benefit from it. If you have text in any European language (other than English), don’t save your text file as “.txt” instead save it as “.bytes” and do the following:
using System.Text
.
.
.
TextAsset lngr = (TextAsset) Resources.Load(“Text/info”);
string txt = Encoding.UTF7.GetString(lngr.bytes);
3 Likes
Hi. I had the same problem with different languages and Resources.Load.
The problem is the coding of the textfile. Normally the Windows-Texteditor (and many other Textprograms) saving textfiles as ANSI.
The only thing you have to do is to save the textfile as UTF8.
1 Like