Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

UTF8 lithuanian characters unrecognized in MySQL database

Codes here !

Moderators: macek, egami, gesf

UTF8 lithuanian characters unrecognized in MySQL database

Postby chemchampa » Wed Apr 10, 2013 3:07 pm

I have well known but quite difficult to sort out problem here. And yes I was searching on forum but those threads are old enough so I decided to create new post. So I built a website using WP and included html FORM in one page. When user fills the form (in his/her language) the values of the fields' go into MySQL database table reg_form.
Everything works, the values are saved, BUT some characters (specific in that language) are not recognized. I tried a lot of different methods to solve this, but nothing can help.
The strangest thing is that if you look at WordPress tables you can find those specific characters are recognizable but not in reg_form table which I created.
I was trying to solve this problem and finally I decided to approach in somehow ridiculous way. I created NEW database, new tables, installed new wordpress, created new form etc.

That‘s what I was doing:

I used this suggestion first: http://tympanus.net/codrops/2009/08/31/ ... -8-issues/

Yes, my files are saved using UTF8 encoding (without BOM). Yes, meta tags are ok. Yes, the FORM uses accept-charset='UTF-8'. Yes, all tables in database use UTF8. Yes, server, database and tables collation is the same “utf8_general_ci”.

Then I tried to insert in my code this:

Code: Select all
$conn = mysql_connect($server, $username, $password);

mysql_set_charset("UTF8", $conn);


Then I tried this suggestion link here: http://akrabat.com/php/utf8-php-and-mysql/

Then I tried to set Apache's AddDefaultCharset in .htaccess file using this link here: http://httpd.apache.org/docs/2.0/mod/co ... ultCharset

BUT… still the problem remains. I can’t see those specific characters properly – only weird hieroglyphic.
chemchampa
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Apr 10, 2013 3:02 pm

Re: UTF8 lithuanian characters unrecognized in MySQL databas

Postby johnj » Wed Apr 10, 2013 8:30 pm

In your php.ini file, can you turn off the value for mbstring encoding translation
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: UTF8 lithuanian characters unrecognized in MySQL databas

Postby chemchampa » Thu Apr 11, 2013 8:53 am

Johnj, if it's a question, YES I just can set it to "OFF" : )
chemchampa
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Apr 10, 2013 3:02 pm

Re: UTF8 lithuanian characters unrecognized in MySQL databas

Postby johnj » Thu Apr 11, 2013 8:45 pm

After setting it to off, did you refresh the page, are u able to see those characters properly.?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: UTF8 lithuanian characters unrecognized in MySQL databas

Postby chemchampa » Fri Apr 12, 2013 8:27 am

Thank you, Johnj for trying to help me : )

I fixed this problem yesterday by myself. If you're interested how did I do that check this post here:
http://forums.phpfreaks.com/topic/276796-utf8-lithuanian-characters-unrecognized-in-mysql-database/

BUT

Now, I have another problem. I can see those lithuanian specific characters in database but when I'm trying to export those data to excel file (through php code) that stupid MS Excel do not recognize those specificl characters : )) So now the fixed problem turns in to the other problem : ))
Here is more detail explanation of my issue:
http://forums.phpfreaks.com/topic/276847-convert-utf8-characters-to-iso-when-exporting-from-mysql-db-to-excel-file/
chemchampa
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Apr 10, 2013 3:02 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.