Android Question convert ISO-8859-1 to UTF8

sirjo66

Well-Known Member
Licensed User
Longtime User
Hello,
I'm trying to convert an ISO-8859-1 string into UTF8 string format for to view it in WebView view.

This is the problem: I download this page http://www.teletexto.com/teletexto.asp?programacion=Antena 3&tv=n with HTTP and the result go into a "Html" String variable.
If you take a look at html source, you see that this page is in iso-8859-1 character set.

So, if I use:
B4X:
webviewobject.LoadHtml(Html)
I don't see correct text (see image1.png).
I have try to change iso-8859-1 text into utf8 text but I don't know how to do it.
I have try each of it:
B4X:
Dim arr() As Byte = Html.GetBytes("ANSI")
Html = BytesToString(arr, 0, arr.Length, "UTF8")
B4X:
Dim arr() As Byte = Html.GetBytes("Windows-1252")
Html = BytesToString(arr, 0, arr.Length, "UTF8")
B4X:
Dim arr() As Byte = Html.GetBytes("iso-8859-1")
Html = BytesToString(arr, 0, arr.Length, "UTF8")

But don't work

Sergio
 

Attachments

  • image1.png
    image1.png
    95.5 KB · Views: 456
Top