Monday, August 07, 2006

Note about utf8_bin

utf8_bin collation on UNIQUE columns needs to be used with caution. In latin1

f == F so a duplicate error would be thrown if a user entered in 'F' when 'f' already existed.

With utf8_bin f != F so, make sure to normalize your data before sticking it into the dblayer i.e. put all email addresses, tags, etc in your db as lowercase :)

Thanks for reminding me Peter Z!!


Cesium said...

Are there session settings that screw up utf8 string comparisons? I was inserting a unique varchar field from ruby that was the french spelling for "Hotel" (circumflex over the 'o'), and got a duplicate key error. Which was wierd because we had just executed sql to check for the existance of the field and the application was running with no other processes in the system. Additionall, copying the sql to a mysql terminal session and executing it successfully inserted the row.

Seun Osewa said...
This comment has been removed by the author.
Seun Osewa said...

Why use utf8_bin? Is it faster?

sexy said...



A片,色情,成人,做愛,情色文學,A片下載,色情遊戲,色情影片,色情聊天室,情色電影,免費視訊,免費視訊聊天,免費視訊聊天室,一葉情貼圖片區,情色,情色視訊,免費成人影片,視訊交友,視訊聊天,視訊聊天室,言情小說,愛情小說,AIO,AV片,A漫,av dvd,聊天室,自拍,情色論壇,視訊美女,AV成人網,色情A片,SEX