Rommeo Posted April 17, 2011 Share Posted April 17, 2011 my db's charset and connection type is utf8_unicode_ci php files are utf8 I have two names blue facileæ When I search for ; blue - script can find it facil - script can find the facileæ and prints facileæ - can not find when there is a character which is not in english alphabet, I can not get the result Whal else should I change ? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 17, 2011 Share Posted April 17, 2011 This may be of some use: mysql_set_charset Quote Link to comment Share on other sites More sharing options...
Rommeo Posted April 17, 2011 Author Share Posted April 17, 2011 I have tried that and set it to UTF-8 actually I set whatever I can set to UTF-8 but nothing changed. no problem while saving or printing, but can not search by greek or french letters Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 17, 2011 Share Posted April 17, 2011 Run this: SHOW CREATE TABLE table_name it will tell you what character set your table is, if it is something other than utf-8, that could cause a problem Quote Link to comment Share on other sites More sharing options...
Rommeo Posted April 17, 2011 Author Share Posted April 17, 2011 I did and everything there is UTF-8 too which actually supports the characters I type. Thats how it prints the data correctly, just the searching section is not working. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 17, 2011 Share Posted April 17, 2011 do you use mysql_set_charset() before you do you do the search? Quote Link to comment Share on other sites More sharing options...
Rommeo Posted April 17, 2011 Author Share Posted April 17, 2011 These are what I use actually : mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'"); also added mysql_set_charset('utf8'); after it and tried its same, just works with latin characters. Quote Link to comment Share on other sites More sharing options...
Rommeo Posted April 18, 2011 Author Share Posted April 18, 2011 The thing I have noticed is that ; the data in DB is like : facileæ it prints right when I search for "facile" but most prob can not find when I search for "facileæ" cause of "æ" needs to be converted to æ How can I convert it ? I tried the query by phpmyadmin where user like %facil% and result : facileæ the Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 18, 2011 Share Posted April 18, 2011 That is why it doesn't work. You didn't store it correctly. it has to look like this in the database: facileæ otherwise you can't search for it. doing a search like this: select * from table where column like '%cile&ael%'; would probably work. basically you have it stored incorrectly, and you will probably have to reinsert it with the correct values. Quote Link to comment Share on other sites More sharing options...
Rommeo Posted April 18, 2011 Author Share Posted April 18, 2011 but utf8_unicode_ci is the correct charset for my needs. even those chars are like that in the db, I dont have even one problem while printing them. As I said just the searching function does not work. I tried others, whenever french chars are working, cannot print greek chars then. now both working right, unfortunately I have no other option about charset. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 18, 2011 Share Posted April 18, 2011 you are storing html entities, the browser knows how to render html entities. So the way you have it you need to search for html entities. 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.