Welcome Guest, Not a member yet? Register   Sign In
charset / encoding problems with CodeIgniter?
#1

[eluser]diez[/eluser]
what is up with code igniter?

...i have no found a single solution and it appears many others are having the same issue.

my problem is that when i try save a string from a textarea box or a textbox which has been copied from an email with a different charset....pasted into a textbox or textarea box....once it is saved into the database....some of the characters are transformered into these funky symbols like such

特别是形声字 ä¸Žç®€ä½“å­—æ— å…³....

however, i have no problems with the charset copying the exact same string using phpMyAdmin to insert the string.

even if i write my own script without using CodeIgniter i have no problems.

i only get this problem using CodeIgniter.

I have checked all the CodeIniter config files (the database config file as well) i have checked my MySQL tables...and all my html files for the proper encoding of UTF-8.


here is the string i have copied from an email.

"– Double Peeling with Fruit acids and pure Vitamin C. The results… spectacular."

(i hope the above string stays encoded properly)

and here is what i get after it has been saved into MySQL using CodeIgniter

"� Double Peeling with Fruit acids and pure Vitamin C. The results� spectacular."


I hope there is someone out there that can help me and the many of the people who are having the same issue.
#2

[eluser]XORd[/eluser]
come on, nobody has an answer here?
we need better UTF-8 support, including database.
i am stuck with encoding problems, URI disallowed characters, database going crazy!
#3

[eluser]Adi Setiawan[/eluser]
just wondering, did you enable global_xss_filtering ? not sure too but perhaps it's strip some characters.
Are you using 1.7.1 ?
#4

[eluser]diez[/eluser]
i used the ascii_to_entities() function using CI's text helper

i'm pretty sure this solved my problem.

as stated from the documentation: (http://ellislab.com/codeigniter/user-gui...elper.html):

Quote:Converts ASCII values to character entities, including high ASCII and MS Word characters that can cause problems when used in a web page, so that they can be shown consistently regardless of browser settings or stored reliably in a database. There is some dependence on your server's supported character sets, so it may not be 100% reliable in all cases, but for the most part it should correctly identify characters outside the normal range (like accented characters).




Theme © iAndrew 2016 - Forum software by © MyBB