0

I've got a problem with inserting two rows to table. The database is in UTF8. The problem seems to be connected to the collation. This statement works:

insert into test(code,text) values('xx','aaa');

However when i try to add other row to the table:

insert into test(code,text) values('xx','aąą');

it fails with duplicate entry error. It looks like a and ą (special polish character) are threated the same. The weird thing is that when i set all collations to utf8_unicode_ci it still does not work :/ Any help will be appreciated :)

soku11
  • 1
  • 1
  • We had the same thing yesterday. Hang on... – Pekka Aug 18 '10 at 20:38
  • 3
    possible duplicate of [MySQL and polish words ](http://stackoverflow.com/questions/3506338/mysql-and-polish-words) – Pekka Aug 18 '10 at 20:38
  • Changing column collation to polish_ci solved the problem. But is it possible to use unicode collation? I'm asking because this table won't be used to polish entries only. – soku11 Aug 18 '10 at 21:05

1 Answers1

0

This should do the trick:

insert into test(code,text) values('xx',N'aąą');

The letter N is for Unicode insert.

Cosmin
  • 21,216
  • 5
  • 45
  • 60
  • im having [a similar issue.](https://stackoverflow.com/questions/53217875/which-collation-to-use-so-that-%C5%9F-and-s-are-treated-as-unique-values) do you know which collation i should use? – oldboy Nov 08 '18 at 23:53