Question

Well i am developing an app for android and my app is sending data to my database the problem is I want to to have different languages and I am having some problems keeping the names right due to Mysql Collation.

I mean if I send something like this: "José" the collation cuts me the word in to "Jos"(That's portuguese by the way) but if I want to use other language I cannot use the collation to UTF specif.

Is there any way to solve this?(Sorry for my poor English.)

Was it helpful?

Solution

If your tables are utf8 and you're transferring strings like 'José'. It might fix the issue if you set the connection collation to utf8, probably you're using different collations at some layer.

SET NAMES 'utf8';

This will be your first SQL query after you establish the connection.

More information: http://dev.mysql.com/doc/refman/5.6/en/charset-connection.html

If you feel more comfortable with Portuguese there is the Portuguese version of Stackoverflow too, check it out: https://pt.stackoverflow.com/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top