My php Sql is inserting  with £ like "£" in a Database field ITEM_NAME. Actully this is an Iphone Application and I am using this ITEM_NAME for comparing values. I dont want to add  with £. I have utf8_general_ci in database for this field.
I gone through almost all the post rel开发者_如何学JAVAated to that. Can any body please help me about this ?
I apologize for less explaination. I want to know can i insert £ into database without having Â. Actully once it enters in the database as £ and then it causes comparison problems.
You have to enforce utf-8 in several places:
- The column should accept utf-8 (done)
- The connection should be utf-8
- The form sending the value and the page showing results should have utf-8 encoding meta header and be saved as utf-8
The database is utf8_general_ci as the field?
Have you tried the function utf8_decode
I've a similar problem with CakePhp and I've to set the encoding in the Database file configuration...
Use mysqli_set_charset() before every query (or mysql_set_charset()) and ensure that your data itself is in unicode, too.
Run SET NAMES "utf8"
before your query or set it in my.cnf as default-character-set=utf8
.
精彩评论