Android Question Conversion to Unicode

Rusty

Well-Known Member
Licensed User
Longtime User
I am trying to convert a series of values similar to this: 17e6, 17e7... (Khmer characters) into their corresponding "displayable" text. I have loaded the font into the typeface of a view but don't know how to convert the hex into a CHR(17e6) type value that can be used.
Any advice would be appreciated.
Thanks,
Rusty

I was able to display the "base" unicode character by:
B4X:
   t = "17e6"
   Log("final:  " & Chr(Bit.ParseInt(t, 16)))

This results in: final: ៦
Which is the desired result.


Does anybody know how to combine consonants/vowels (modifiers) to the unicode characters?
i.e. ឆឿ
is made up of unicode characters 17bf (ឆ) and 1786 (ឿ)

Thanks for any advice!
Rusty
 
Last edited:

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Erel.
I figured this out with your help from another post http://www.b4x.com/android/forum/threads/when-getting-query-results-i-cant-read-hebrew.27461/#post-159533.
In the mentioned post, you were assisting Danoptic with Greek letters.
by calling your routine UnescapeUnicode as follows:
B4X:
Log(UnescapeUnicode("this is 4 a test \u1786\u17bf"))  'in this order, not \u17bf\u1786
it will combine these types of characters appropriately.
unicode characters 1786 (ឿ) and 17bf (ឆ) results in ឆឿ
Big thanks Erel

Additional (easier) note:
B4X:
    Dim t As Int = 0x1786
    Dim s As Int = 0x17bf
    Log("final: " & Chr(t) & Chr(s))
the above works as well
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…