On the PHP side use mb_convert_encoding($text, "UTF-8") for anything you 
are sending to the client. You can also use that function to convert text 
entered from a web form (or anywhere else) before storing it in your PHP 
database.

On Thursday, June 14, 2012 2:42:11 PM UTC-4, Fran wrote:
>
> Hi, 
>
> I am implementing an standalone client/server protocol to make one of my 
> games online capable. One of the problems I have found is that some 
> strings passwed between client and server may have characters that must 
> be encoded on UTF-8 (like spanish ñ for example). 
>
> The first thing I though was using hexadecimal notation for each char, 
> so an string like ESPAÑA will be enconded and sent as: 
>
> 004500530050004100D10041 
>
> But I rather like to avoid this, since it generates an unnecessary 
> network load for just one char, and I expect to have hundreds of 
> concurrent connections, so it is important to loose all the fat I can... 
>
> I have found this altenative notation may be a good alternative: 
>
> ESPAU+00D1A 
>
> But I did not found where it is documented, also I do not know if 
> Android has native functions to handle this, that may be an interesting 
> advantage for prefering one notation over another. 
>
> Also this one, claimed to be "JavaScript escapes" looks interesting, 
> with the same load than the previous one: 
>
> ESPA\u00D1A 
>
> I am using this online tool for my testings: 
>
> http://www.rishida.net/tools/conversion/ 
>
> Well, bearing in mind that the client will be written in Android, and 
> the server in PHP, what you think should be the best option for encoding 
> UTF-8 chars during transmission? 
>
> Regards, 
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to