I have an XPages app that has an interface to a native mobile app (running on Android and iOS). The app can be used as a “full” client to the application – so it both reads and writes data to the Domino based application.
As you probably know we have some extra keyboards on the mobile devices – which allows us to express our emotions. They are called emojis or simply smileys . Normally when we see these special characters in IBM Notes (or web based applications running on IBM Domino) they are translated to something that may not always be visible… – or more correctly, shown as a series of hieroglyphs. Now, one of our users entered a description on his cell phone and included a smiley and submitted it to the server – and it just came back “awkward” – so I decided to try and figure out how to cope with these so often-used special characters.
The journey to the result was long – and I learned a lot about unicode – and didn’t understand everthing (e.g. “high surrogate” and “low surrogate”). And in the end it turned out that I didn’t need to know all this!!
I use an MVC model where I read data into Java objects and after that all data handling is done through the Java objects. A Java String is naturally in unicode (actually it is the “utf-16” character set that uses two bytes per character whereas “utf-8” only uses one byte per character). In Denmark we have three extra national characters (compared to English) and for quite a while I have used “utf-8” to encode any data that needs to be sent to/read from other systems (e.g. in a REST service). This has proved to work well – that is, until now.
NB this page is a placeholder for returning all different data objects as JSON. Therefore, this page is NOT rendered….
And that seems to be it!!! I have been over considerations about how to save data in NotesItems (as MIMEentities instead of a pure NotesItem) – and converting the emojis as per the article about MySQL (see below) – but none of this seems necessary!! – in my environment anyway.
And now our users can express emotions when describing the fish they caught (its an angler’s app) – without breaking anything and without us having to remove the funny little characters!
How to stream file from xPages?