I’m using the following code to read the contents of the text file. The file is encoded in some sort of Utf8 format:
String File = "ms-appx:///Arabic/file.txt";
contents = await Windows.Storage.PathIO.ReadTextAsync(File, Windows.Storage.Streams.UnicodeEncoding.Utf8);
But the above gives me the error:
WinRT information: No mapping for the Unicode character exists in the target multi-byte code page.
Any ideas what I’m doing wrong here?
Thanks
I had a similar issue trying to read text files that contained certain characters (’, °, –) in a file that was using “Western European (Windows) – Codepage 1252” encoding.
The solution in my case was to force Visual Studio to save the files using UTF-8 encoding.