I’m using Mono for Android (C#) and WebClient DownloadString to get source code of a HTML website, that uses special characters (č,š,ž – charset=windows-1250). But when displaying the code, it shows � instead of the characters. Is there a way to show the correct characters?
I’m using MonoDevelop.
I’m using Mono for Android (C#) and WebClient DownloadString to get source code of
Share
When you use
DownloadString, .NET (and I suppose Mono, too) automatically assumes that downloaded data are encoded in UTF-8. In your case, that is not so, hence the � characters.Instead of
DownloadString, useDownloadDatato download raw bytes and convert them to UTF-8: