R RichardN Well-Known Member Licensed User Longtime User May 19, 2016 #1 I am using this code to read some .htm files into an iWebView: Code: Copy Private html As String = File.ReadString(File.DirAssets, HTMLfilename) WebView1.LoadHtml(html) The File.Readstring() function appears to throw an exception at any input file that is not encoded in UTF8. (Unable to read file. Incorrect coding). I can of course load all my ANSI HTML files into MS Notepad and then save them as UTF8 but that is a complete PITA. Is there a simpler method that will read the ANSI files without the conversion ?
I am using this code to read some .htm files into an iWebView: Code: Copy Private html As String = File.ReadString(File.DirAssets, HTMLfilename) WebView1.LoadHtml(html) The File.Readstring() function appears to throw an exception at any input file that is not encoded in UTF8. (Unable to read file. Incorrect coding). I can of course load all my ANSI HTML files into MS Notepad and then save them as UTF8 but that is a complete PITA. Is there a simpler method that will read the ANSI files without the conversion ?
Erel B4X founder Staff member Licensed User Longtime User May 19, 2016 #2 Yes. Use File.ReadString2 which allows you to set the charset (you probably need "windows-1255"). Upvote 0