P Penko Active Member Licensed User Longtime User May 23, 2012 #1 Hello there. I am using PostString to initiate a POST query and parse the response. It is html but I can't find a way to get it with the proper encoding. The page I am parsing uses windows-1251 while Android is UTF8 natively. I am using the html in a WebView but the texts are "???????????????" as I said. I tried to change HttpUtils GetBytes to "Windows-1251" but it didn't help.
Hello there. I am using PostString to initiate a POST query and parse the response. It is html but I can't find a way to get it with the proper encoding. The page I am parsing uses windows-1251 while Android is UTF8 natively. I am using the html in a WebView but the texts are "???????????????" as I said. I tried to change HttpUtils GetBytes to "Windows-1251" but it didn't help.
Erel B4X founder Staff member Licensed User Longtime User May 23, 2012 #2 I guess that the problem is actually in the response. If it is not UTF8 then you cannot use HttpUtils.GetString. You can use this code to read non-UTF8 strings: Code: Copy Dim tr As TextReader tr.Initialize2(HttpUtils.GetInputStream, "Windows-1251") Dim s As String s = tr.ReadAll Upvote 0
I guess that the problem is actually in the response. If it is not UTF8 then you cannot use HttpUtils.GetString. You can use this code to read non-UTF8 strings: Code: Copy Dim tr As TextReader tr.Initialize2(HttpUtils.GetInputStream, "Windows-1251") Dim s As String s = tr.ReadAll
P Penko Active Member Licensed User Longtime User May 23, 2012 #3 That did the trick, thanks! Upvote 0