What confuses what needs to be done is parsing and at what end is the client / server.
When i send an Umlaut 'Γ' to my ejabberd, it is received by ejabberd as <<"195, 150">>
After that, I will send this to my client in the form of push notifications (via GCM / APNS). From there, the client builds UTF-8 decoding for each digit one at a time (this is wrong).
ie 195 is first decoded to gibberish character and so on.
This reconstruction needs identification if you need to use two bytes or 3 or more. It depends on the language of the letters (German here, for example).
How does the client identify which language it is going to recover (the number of bytes to decode at a time)?
To add more
lists:flatten(mochijson2:encode({struct,[{registration_ids,[Reg_id]},{data ,[{message,Message},{type,Type},{enum,ENUM},{groupid,Groupid},{groupname,Groupname},{sender,Sender_list},{receiver,Content_list}]},{time_to_live,2419200}]})).
Produced by json as:
"{\"registration_ids\":[\"APA91bGLjnkhqZlqFEp7mTo9p1vu9s92_A0UIzlUHnhl4xdFTaZ_0HpD5SISB4jNRPi2D7_c8D_mbhUT_k-T2Bo_i_G3Jt1kIqbgQKrFwB3gp1jeGatrOMsfG4gAJSEkClZFFIJEEyow\"],\"data\":{\"message\":[104,105],\"type\":[71,82,79,85,80],\"enum\":2001,\"groupid\":[71,73,68],\"groupname\":[71,114,111,117,112,78,97,109,101],\"sender\":[49,64,100,101,118,108,97,98,47,115,100,115],\"receiver\":[97,115,97,115]},\"time_to_live\":2419200}"
where I gave βhelloβ as a message, and mochijson gave me ASCII values ββ[104, 105].
The groupname field was given the value "Groupname", the ASCIIs are also correct after json creation ie 71,114,111,117,112,78,97,109,101
However, when I use http://www.unit-conversion.info/texttools/ascii/
It is decodes as Ηo me and not "Groupname".
So who should understand? How the same should be handled.
My reconstructed message is all gibberuish when ASCII is reconstructed.
thanks