yadakhov / insert-on-duplicate-key

MIT License
275 stars 51 forks source link

Punctuated strings #22

Open doubledot-web opened 6 years ago

doubledot-web commented 6 years ago

Hi @yadakhov! Thanks for your great work!

I'm trying to store some strings to a database but, in some cases, I need a punctuated version of the same string to be inserted to a table.

An example could be a string like 'cascos para niños' and 'cascos para ninos'. I need both of them to be inserted in a table but, currently, they are considered to be equal preventing them to be inserted twice as different values.

Is there a way I could store them both?

Thanks!

spawn-guy commented 5 years ago

@doubledot-web they are not "punctuated" your strings are "accented". indexing relies on column character set (or table-default or database-default). with your current set up, engine doesn't differentiate accented and non-accented stings - thus you have this situation.

read more about character sets and settings and re-configure your database accordingly. https://mysqlserverteam.com/mysql-8-0-1-accent-and-case-sensitive-collations-for-utf8mb4/