Hello community,
I am struggling to get emoticons from the string one-by-one.
Consider this:
I have a string with emoticons. This string is correctly displayed when displaying it as whole string .
It correctly show the whole string.
But when I try to iterate if one character after another, it always gives me �. or ��.
I understand, that emoticons are binary characters and cannot be represented as one byte, but they are as two bytes.
However, when I do this code:
The idea is to create buttons for each character (emoji) in the string. When I put whole string to the button.text property, it is displayed correctly. But when I ietrate string, it gives me twice as much buttons and each of them has text as �.
Anybody has a clue how to achieve this?
Many thanks
I am struggling to get emoticons from the string one-by-one.
Consider this:
I have a string with emoticons. This string is correctly displayed when displaying it as whole string .
B4X:
Dim str as string = "????????❤️"
Log(str)
But when I try to iterate if one character after another, it always gives me �. or ��.
I understand, that emoticons are binary characters and cannot be represented as one byte, but they are as two bytes.
However, when I do this code:
B4X:
For i = 0 To str.Length - 1
Log(str.CharAt(i)) ' this gives � or ��
Log(str.Substring2(i,i+1)) ' this gives same ouput as CharAt.
Next
The idea is to create buttons for each character (emoji) in the string. When I put whole string to the button.text property, it is displayed correctly. But when I ietrate string, it gives me twice as much buttons and each of them has text as �.
Anybody has a clue how to achieve this?
Many thanks