Android Question Help to convert from unicode

Thomas Philip C

Member
Licensed User
Longtime User
Hi All,

I am new to basic 4 android and i currently have a problem .. below is my code

data = c.Decrypt(data, kg.key, False)
datas=Bconv.StringFromBytes(data,"UTF8")

the issue is that it gives my result in unicode

eg

\u0054\u0068\u006f\u006d\u0061\u0073 instead of "Thomas"

Any help will be appreciated.
Regards,
Thomas
 

Thomas Philip C

Member
Licensed User
Longtime User
Hey erel ,

how would i convert free text to unicode points ( the reverse of this process)

i.e

Thomas to \u0054\u0068\u006f\u006d\u0061\u0073
 
Upvote 0

Thomas Philip C

Member
Licensed User
Longtime User
thanks i was somewhere close to it with my codes. was figuring on how to pad the extra zeros..

Sub EscapeUnicode(s As String) As String
Dim sb As StringBuilder
sb.Initialize
Dim i As Int
Do While i < s.Length
Dim c As Char = s.CharAt(i)
'need to change to unicode here
sb.Append("u\")



Dim codepoint As Int = Asc (c)

Log(Bit.ToHexString(codepoint))
Log(codepoint)
Dim str As String
str= Bit.ToHexString(codepoint)


sb.Append(str)
i = i + 1
Loop
Return sb.ToString
End Sub

thanks again. much appreciated.
 
Upvote 0
Top