Android Question [SOLVED] iso-8859-1 and utf-8 problem

sirjo66

Well-Known Member
Licensed User
Longtime User
Hello all :)

I have a program that is an HttpServer and I have this code:

B4X:
Sub Server_HandleRequest (Request As ServletRequest, Response As ServletResponse)

        Log("Text: " & Request.GetParameter("testo"))

If the customer call mypage with:
http://192.168.0.xxx:5555/mypage?testo=hello world
it works very well !!
also it works with
http://192.168.0.xxx:5555/mypage?testo=hello world è !

but with this command:
http://192.168.0.xxx:5555/mypage?testo=hello%20world%20%E8%20%21
don't works :(
%E8 is the char-code of char "è" (on ISO-8859-1) and I don't know how to manage it

On log it appeare:
Text: hello world ?!

I have also try to change ISO-8859-1 in utf-8:
B4X:
    Dim var As String = Request.GetParameter("testo")
     Dim arrByte() As Byte
     arrByte = var.GetBytes("ISO-8859-1")
     Dim result As String  = BytesToString(arrByte, 0, arrByte.Length, "UTF8")
     Log("UTF8: " & result)

but the result is the same:
Text: hello world ?!
UTF8: hello world ?!

Help me please :eek:
Sergio
 
Top