I'm using FileIO.ReadTextAsync()
to read an *.htm webpage which I have saved into "ms-appdata:///local", using Utf8 encoding.
But I get a System.ArgumentOutOfRangeException
when doing it. Additional information is No mapping for the Unicode character exists in the target multi-byte code page
.
Reading an ordinary *.txt file using the same function works fine. What am I doing wrong ?
Edit : Code
async private void Button_Click(object sender, RoutedEventArgs e)
{
StorageFile SF = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appdata:///local/test3.html"));
string html = await FileIO.ReadTextAsync(SF, Windows.Storage.Streams.UnicodeEncoding.Utf8);
}
Change the file encoding using Visual Studio. When I opened the file it had the encoding: "Western European (Windows) - Codepage 1252"