Hi all,
I'd like to enable the use of emoji/emoticons/smileys (well, I don't know how to call them) in a chat program I developed for B4A and B4J. Messages are exchanged by means of an external MQTT server.
My first idea was to convert the whole message to UTF32 so any char would consume 4 bytes, but it sounds like a wasting of space.
Another option was to use a kind of start/stop sentinel char to delimit positions in the message where the smileys had to appear, but since any of the 4 bytes constituting a smiley (Unicode 32) could have the same value as mine start/stop sentinel that's not the solution.
Now I'm planning to add a couple of separate fields to my MQTT message, where the first one contains the 4-bytes emoticons encoding while the other is used to record the position in the general message where to show each of the emoticons (if any).
It sounds a bit complex, so I prefer to ask here how you eventually solved anything similar before going to the drawing board.
ps: I started reading this thread.
pps: using B4J 6.00 it seems that the loading of a specific font is not necessary anymore
I'd like to enable the use of emoji/emoticons/smileys (well, I don't know how to call them) in a chat program I developed for B4A and B4J. Messages are exchanged by means of an external MQTT server.
My first idea was to convert the whole message to UTF32 so any char would consume 4 bytes, but it sounds like a wasting of space.
Another option was to use a kind of start/stop sentinel char to delimit positions in the message where the smileys had to appear, but since any of the 4 bytes constituting a smiley (Unicode 32) could have the same value as mine start/stop sentinel that's not the solution.
Now I'm planning to add a couple of separate fields to my MQTT message, where the first one contains the 4-bytes emoticons encoding while the other is used to record the position in the general message where to show each of the emoticons (if any).
It sounds a bit complex, so I prefer to ask here how you eventually solved anything similar before going to the drawing board.
ps: I started reading this thread.
pps: using B4J 6.00 it seems that the loading of a specific font is not necessary anymore