2017-12-11 1 views
0

실제로 동일한, 문제는 결과가 0MySQL의 설정 이름 UTF8, "포켓몬"과 "포켓 몬스터"나는 MySQL의 명령 줄을 테스트?

STRCMP('pokemon','pokémon') 
0 

입니다

set names utf8; 

select STRCMP('pokemon','pokémon'); 

나를 혼동이 내가 -1 또는 1 또는 무엇인가 보여 주길 바란다

나는 "설정 이름 latin1"을 시도했다, 그것은 그들이 동등하지 않다는 것을 보여준다.

set names latin1; 
select STRCMP('pokemon','pokémon'); 

결과는? 문제 야 내가 UTF8에서 latin1에 같은 결과를 가질 수있는 1

STRCMP('pokemon','pokémon') 
1 

입니까?

+0

* 대조는 당신이 찾고있는 개념이지 인코딩이 아닙니다. 인코딩 설정에서 암시 적으로 데이터 정렬 규칙이 따르지만 별도로 설정할 수 있습니다. – deceze

+0

예를 들어'select strcmp ('pokemon'collate utf8_bin, 'pokémon'); ' – xs0

+0

다른 해결책이 있습니까? – user6198296

답변

0
In all of these collations you will find that 'e' = 'ê'. 
utf8_czech_ci 
utf8_danish_ci 
utf8_esperanto_ci 
utf8_estonian_ci 
utf8_general_ci 
utf8_hungarian_ci 
utf8_icelandic_ci 
utf8_latvian_ci 
utf8_lithuanian_ci 
utf8_persian_ci 
utf8_polish_ci 
utf8_roman_ci 
utf8_romanian_ci 
utf8_sinhala_ci 
utf8_slovak_ci 
utf8_slovenian_ci 
utf8_spanish_ci 
utf8_spanish2_ci 
utf8_swedish_ci 
utf8_turkish_ci 
utf8_unicode_ci