Sharmaji
Sharmaji

Reputation: 599

Problem With  character

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 related 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.

Upvotes: 2

Views: 672

Answers (4)

Majid Fouladpour
Majid Fouladpour

Reputation: 30252

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

Upvotes: 2

powtac
powtac

Reputation: 41050

Run SET NAMES "utf8" before your query or set it in my.cnf as default-character-set=utf8.

Upvotes: 0

str
str

Reputation: 44969

Use mysqli_set_charset() before every query (or mysql_set_charset()) and ensure that your data itself is in unicode, too.

Upvotes: 0

jjchiw
jjchiw

Reputation: 4445

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...

Upvotes: 0

Related Questions