M m643 Member Licensed User Longtime User Jul 10, 2013 #1 Hi, I'm trying to insert some text with special characters like éé or ë into my sqlite db (column=plot TEXT). Problem is that it saves null values when the text containts special characters. In my mysql database the field has utf8 as collation. How can I solve this?
Hi, I'm trying to insert some text with special characters like éé or ë into my sqlite db (column=plot TEXT). Problem is that it saves null values when the text containts special characters. In my mysql database the field has utf8 as collation. How can I solve this?
Erel B4X founder Staff member Licensed User Longtime User Jul 11, 2013 #2 Have you added the PHP line that sets the encoding to UTF8? It is a single line that you need to add to the PHP script. I've added it in the MySQL tutorial. Upvote 0
Have you added the PHP line that sets the encoding to UTF8? It is a single line that you need to add to the PHP script. I've added it in the MySQL tutorial.
M m643 Member Licensed User Longtime User Jul 11, 2013 #3 Erel said: Have you added the PHP line that sets the encoding to UTF8? It is a single line that you need to add to the PHP script. I've added it in the MySQL tutorial. Click to expand... Do you mean the line in the query: mysql_query("SET CHARACTER SET utf8");? I also tried $string= utf8_encode ( $plot); Upvote 0
Erel said: Have you added the PHP line that sets the encoding to UTF8? It is a single line that you need to add to the PHP script. I've added it in the MySQL tutorial. Click to expand... Do you mean the line in the query: mysql_query("SET CHARACTER SET utf8");? I also tried $string= utf8_encode ( $plot);
Erel B4X founder Staff member Licensed User Longtime User Jul 12, 2013 #4 Yes: http://www.b4x.com/forum/basic4andr...nnect-android-mysql-database-tutorial-27.html Upvote 0
M m643 Member Licensed User Longtime User Jul 12, 2013 #5 Erel said: Yes: http://www.b4x.com/forum/basic4andr...nnect-android-mysql-database-tutorial-27.html Click to expand... Hi Erel, I added mysql_query("SET CHARACTER SET utf8"); I deleted all the data in my mysql db, convert all columns to utf8 and loaded the data again. But still get nulls in my sqlite db. :sign0085: Upvote 0
Erel said: Yes: http://www.b4x.com/forum/basic4andr...nnect-android-mysql-database-tutorial-27.html Click to expand... Hi Erel, I added mysql_query("SET CHARACTER SET utf8"); I deleted all the data in my mysql db, convert all columns to utf8 and loaded the data again. But still get nulls in my sqlite db. :sign0085:
mc73 Well-Known Member Licensed User Longtime User Jul 12, 2013 #6 In my php I had to set Code: mysql_query( "SET NAMES utf8", $con); mysql_query( "SET CHARACTER SET utf8", $con); Worked for me. Upvote 0
In my php I had to set Code: mysql_query( "SET NAMES utf8", $con); mysql_query( "SET CHARACTER SET utf8", $con); Worked for me.
M m643 Member Licensed User Longtime User Jul 14, 2013 #7 mc73 said: In my php I had to set Code: mysql_query( "SET NAMES utf8", $con); mysql_query( "SET CHARACTER SET utf8", $con); Worked for me. Click to expand... I tried this but still getting nulls. How do you create the columns in sqlite, just "plot TEXT"? Upvote 0
mc73 said: In my php I had to set Code: mysql_query( "SET NAMES utf8", $con); mysql_query( "SET CHARACTER SET utf8", $con); Worked for me. Click to expand... I tried this but still getting nulls. How do you create the columns in sqlite, just "plot TEXT"?
mc73 Well-Known Member Licensed User Longtime User Jul 14, 2013 #8 m643 said: I tried this but still getting nulls. How do you create the columns in sqlite, just "plot TEXT"? Click to expand... Yes. How did you create your mysql tables? Sure about their encoding? Upvote 0
m643 said: I tried this but still getting nulls. How do you create the columns in sqlite, just "plot TEXT"? Click to expand... Yes. How did you create your mysql tables? Sure about their encoding?