web_master Posted February 25, 2008 Share Posted February 25, 2008 hi, Ive got a problem. Look the site www.tetszik.hu 1. I use in MySql "latin1_swedish_ci" collation and when I send the text in admin panel with form in dbase text is looks good. 2. Then I export table from dbase (with data), and when I put it back I have the "??" as You see. 3. If I use the "utf8_unicode" (or other utf- enconding in sql base the came the "??" in a moment whet I put a character via form in dbase. Not all but some chars, like Ő, Í, Á ”... What can be a problem? - is the problem on server? Quote Link to comment Share on other sites More sharing options...
thebadbad Posted February 25, 2008 Share Posted February 25, 2008 Make sure every character set setting in your database is utf8 (I'm using utf8_unicode_ci for all my database and table collations). Also, the charset in your HTML should be utf8, but I see you've got that right. Now, when doing any database interaction, put these queries before your MySQL query: <?php mysql_query("SET NAMES 'utf8'", $connection); mysql_query('SET CHARACTER SET utf8', $connection); ?> This should solve it. Quote Link to comment Share on other sites More sharing options...
web_master Posted February 25, 2008 Author Share Posted February 25, 2008 OK, I will made this changes. Only problem is, that this was fork for a few weeks ago... and on this server Ive got a lots of a sites, and than I must make a changes on a thousand of files ... but still I dont understand why if I put the characters via form will be good (readable), and after export from dbase, and put it back in dbase this char will change on "??" Quote Link to comment Share on other sites More sharing options...
thebadbad Posted February 25, 2008 Share Posted February 25, 2008 If you have a lot of data in latin1 you should find some way to convert it to utf8. The data should stay as is when exporting/importing from and to the same database. But if you import some non-unicode data into an unicode database, and vice versa, you'll likely have some corrupted data. So, if you're dealing with different (written) languages on one server (or simply use 'unusual' characters), your only option is to use utf8. Quote Link to comment Share on other sites More sharing options...
web_master Posted February 25, 2008 Author Share Posted February 25, 2008 this is a server problem I think because in ut8 collation I cannot even put a chars to stay a good char, because in moment willbe changed to a "??" I take care about a collations in whole dbase to be everything a latin1_swedish or utf8_unicode... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.