메뉴 건너뛰기

GREATUSER

free

MySQL 8.0: ひらがなカタカナを判別する日本語用Collation 以前の記事では、MySQL 8.0.1で導入された新しい 日本語のutf8bm4のCollation(文字照合順)について ご紹介しました。このcollation (utf8mb4_ja_0900_as_cs) は、CLDR 30で定義されたアクセント記号(清音濁音半濁音)ならびに大文字小文字(拗音促音など)を判別する実装となっています。 今日ご紹介するのはひらがなカタカナを判別できる新しい「かなセンシティブ」なCollation utf8mb4_ja_0900_as_cs_ksです。DUCETではひらがながカタカナよりも前にソートされるように3次レベルの重みを定義しています。例えば: 3042 ; [.3D5A.0020.000E] # HIRAGANA LETTER A 30A2 ; [.3D5A.0020.0011] # KATAKANA LETTER A 2次レベルでの違い(000E および 0011)によって 0x3042 (あ) < 0x30A2 (ア) となります。CLDRではひらがなとカタカナの違いは4次レベル(例: &あ<<<<ア)で比較するよう定義されています。デフォルトの比較レベルは3次レベル(強さ 3)となっており、最初の3次レベルでみると同じとなります。 utf8mb4_ja_0900_as_cs_ksについて utf8mb4_ja_0900_as_csに対していただいたフィードバックにお応えする形で、ひらがなとカタカナを判別する新しいCollationである utf8mb4_ja_0900_as_cs_ks を追加することにしました。ここでの’_ks’は「かなセンシティブ Kana Sensitive」を意味しています。 このCollationは最初の3次レベルまでが同じひらがなとカタカナの判別に必要となる4次レベルでの処理を行います。以下の例では、utf8mb4_ja_0900_as_cs および utf8mb4_ja_0900_as_cs_ks のそれぞれのCollationでの文字列比較結果です: mysql> SET @s1 = CONVERT('きゅう' USING utf8mb4); Query OK, 0 rows affected (0.01 sec) mysql> SET @s2 = CONVERT('キュウ' USING utf8mb4); Query OK, 0 rows affected (0.00 sec) mysql> SET @s3 = CONVERT('きゆう' USING utf8mb4); Query OK, 0 rows affected (0.00 sec) mysql> SET @s4 = CONVERT('キユウ' USING utf8mb4); Query OK, 0 rows affected (0.00 sec) mysql> SELECT STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs, @s2); +------------------------------------------------+ | STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs, @s2) | +------------------------------------------------+ | 0 | +------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT STRCMP(@s2 COLLATE utf8mb4_ja_0900_as_cs, @s3); +------------------------------------------------+ | STRCMP(@s2 COLLATE utf8mb4_ja_0900_as_cs, @s3) | [ more... ]

The post MySQL 8.0: ひらがなカタカナを判別する日本語用Collation appeared first on 지락문화예술공작단.




원문출처 : https://jirak.net/wp/mysql-8-0-%E3%81%B2%E3%82%89%E3%81%8C%E3%81%AA%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A%E3%82%92%E5%88%A4%E5%88%A5%E3%81%99%E3%82%8B%E6%97%A5%E6%9C%AC%E8%AA%9E%E7%94%A8collation/
번호 제목 글쓴이 날짜 조회 수
280 2017 will be an epic year for Xbox One and Windows 10 gamers 관리자 2017.02.18 15
279 Fallout Shelter now available for Windows 10 and Xbox One 관리자 2017.02.08 15
278 Surface Hub announces customer subscription, deployment options and application innovation 관리자 2017.02.08 15
277 Windows 10 Tip: Stay in sync with OneDrive 관리자 2017.01.31 15
276 Amazon Cloud Directory – 클라우드 기반 신규 디렉토리 관리 서비스 출시 관리자 2017.01.27 15
275 Introducing Windows Defender Security Center 관리자 2017.01.24 15
274 New Windows 10 upgrade benefits for Windows Cloud Subscriptions in CSP 관리자 2017.01.20 15
273 Sushi = Beer ?! An introduction of UTF8 support in MySQL 8.0 관리자 2017.01.14 15
272 Introducing support for Content Security Policy Level 2 관리자 2017.01.11 15
271 9 plugins you should definitely have heard of to prevent data leaks, security breaches and to get more flexibility in the way you log in to your Piwik. 관리자 2017.01.10 15
270 CES 2017: HP announces redesigned Sprout Pro, 4K PCs and curved gaming display 관리자 2017.01.04 15
269 CES 2017: Lenovo updates the ThinkPad X1 family and introduces new gaming PCs 관리자 2017.01.04 15
268 Windows 10 Tip: Enable “Hey Cortana” and teach Cortana to recognize your voice 관리자 2017.01.03 15
267 It’s the most wonderful time of the year – for Surface! 관리자 2016.12.13 15
266 The next generation of makers: UW Formula Motorsports Team 관리자 2016.12.06 15
위로