When I try to connect to an url like ws://mañana.com I get an error. Here is the log:
If I manually convert to ws://xn--maana-pta.com all works ok. Looking at websocket sources error is in mWsUri.getHost() function.
Is there any function to transform a punycode url into a "normal" url with B4x?
TIA!
B4X:
Error occurred on line: 19 (WebSocketHandler)
de.tavendo.autobahn.WebSocketException: no host specified in WebSockets URI
at de.tavendo.autobahn.WebSocketConnection.connect(WebSocketConnection.java:255)
at de.tavendo.autobahn.WebSocketConnection.connect(WebSocketConnection.java:217)
at anywheresoftware.b4a.objects.WebSocketWrapper.Connect(WebSocketWrapper.java:47)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:748)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:343)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
at com.laransoft.riego.main_socket._connect(main_socket.java:203)
at com.laransoft.riego.main_socket._reconnect_tick(main_socket.java:334)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
If I manually convert to ws://xn--maana-pta.com all works ok. Looking at websocket sources error is in mWsUri.getHost() function.
Is there any function to transform a punycode url into a "normal" url with B4x?
TIA!