0

I'm trying to find substring in string using restrictions ilike and MatchMode.ANYWHERE, but it does not work with Russian letters in uppercase. In lower case all okay. Somebody knows what to do with it?

Code Example: Criterion userLikeCriteria = Restrictions.like("username", username, MatchMode.ANYWHERE);

Problem Example: I want to find word: "Москва" (Moscow) and enter a substring to find it: "М" (Russian letter M in uppercase) - and there are no result from database, but if i will enter any other letter except "М" as substring - i will find word "Москва". In the same time if word "Москва" wont contain uppercase letter М - "москва" (moscow), than i will find it when enter a search substring as "м" - Russian letter m in lowercase.

Slava Vedenin
  • 58,326
  • 13
  • 40
  • 59
dikkini
  • 1,184
  • 1
  • 23
  • 52
  • Did you try the same with HQL & native sql ? Hope you have appropriate charset for you DB ? – Jay May 07 '14 at 08:56
  • I did not try the same HQL or native sql because it will work, i'm sure. Problem not in charset, because lowercase russian letters are correctly. – dikkini May 07 '14 at 10:27

0 Answers0