Android Question UTF16 characters in the "high" ranges

Rusty

Well-Known Member
Licensed User
Longtime User
I am trying to display utf16 characters that are above 65000 and having difficulty getting it done.
FE4E6 is the American Flag (as an example).
How does one display this in a Webview, EditText or ???
Thanks in advance.
Rusty
 

Erel

B4X founder
Staff member
Licensed User
Longtime User


B4X:
Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("1")
   WebView1.LoadHtml("<p>&#xFE4E6;</p>")
 
   EditText1.Text = UnicodeToString(0xFE4E6)
End Sub

Sub UnicodeToString (codepoint As Int) As String
   Dim bc As ByteConverter
   Dim b() As Byte = bc.IntsToBytes(Array As Int(codepoint))
   Return BytesToString(b, 0, 4, "UTF32")
End Sub
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Erel!
This looks like it runs on KitKat very well. Can it function on ICS or JellyBean?
Rusty
I tried it on ICS and it doesn't seem to work. Does ICS support the UTF16/32?
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
You are right. I had loaded a custom font and then later in the test program had loaded another ...
I appreciate your help, Erel.
Regards,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
In ICS, the B-) generates a Unicode character and this is working well. The edit text shows the correct smiley.
How can I get the Unicode code point value? Is there a translation table for these texts? If so, it seems they vary between Android OS's...ICS, JB, ...
The reason I need this is that I can't find a "map" that gives the code point value for the text representations (like above).
B4X:
From ICS soft keyboard smiley button
":-)"
"B-)"
":'("
":-["
":-!"
":)"
":-*"
":-D"
":-X"
":-$"
":-O"
":-P"
":-\"
";)"
"o.O"
":0"
":-|"
":("
"x-("
"<3"
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Manfred,
We have written our own and as such, we are mapping them...
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Does anyone know how/where/which codepage/unicode values the Korean character set resides?
If so, can you please advise on how I might reach this in code?
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Erel.
I need t be able to "combine" Unicode characters such as Korean where selecting consonants and vowels result in a single combined ligature/glyph.
Does android/b4a support this function or is there a "formula" by which this can be accomplished?
for example: ㅁ plus ㅕ results in the character 며 adding another ㅁ results in 몀
Regards,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Nothing wrong with being RUSTY, I've been that for my whole life
Thanks for the speedy response.
Do you know how to "Add" the consonant value to the vowel value that points to the codepage/glyph with the resultant character?
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Are there other "formats" for normalize?
Some of the combinations have multiple "pieces" i.e. "ㅁ", "ㅕ", "ㄱ" result in 멱
When I send it an array of three elements, it doesn't combine all three, just the first two and then sets the third as an independent character.
THanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…