Forum Moderators: open

Message Too Old, No Replies

Accent truncating query even though everything is unicode/UTF?

Works fine via phpMyAdmin though truncates through PHP.

         

JAB Creations

10:20 pm on Nov 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Letters with accents are truncating values made when my site executes an INSERT query. The collation for the database, the tables, and any and all application columns are all utf8_general_ci. I also execute the following queries each time I open a MySQL connection...

SET CHARACTER SET 'utf8'
SET NAMES 'utf8'

When I execute the exact same INSERT query via phpMyAdmin however the accent does not cause truncation. Thoughts please?

- John

JAB Creations

7:09 pm on Nov 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It turns out that using the queries above are necessary for getting Unicode characters though is destructive to posting them. A simple if statement cleared the issue up and all 28 languages on my site are correctly working. :)

- John