Why does MySQL handle the Japanese alphabets hiragana and katakana the same way, and how can you make it compatible with Django?

This question was partially addressed here, but I wanted to ask more specifically:

Problems with MySQL - Hiragana and Katakana are treated as such

In Japanese, there are two separate phonetic alphabets describing the same set of sounds, and MySQL apparently treats these two alphabets the same way they handle upper and lower case (so I suppose, not case insensitive , insensitive to the alphabet). However, these two alphabets are not similar to the English case, so it does not make much sense to do this. Does anyone know why they decided to do it this way, and easy work around? More specifically, when connecting to django you get this problem:

>>> ichi = 'イチ' # This word is in katakana
>>> Dictionary.objects.get(word=ichi).word # The record that is returned is in hiragana
'いち' 
>>> Dictionary.objects.get(word=ichi).word == ichi # The words are not the same
False

Does anyone know how I can make the behavior consistent?

+4
source share
1 answer

, , , MySQL hiragana katakana , utf_general_ci.

utf_bin

0

Source: https://habr.com/ru/post/1666541/


All Articles