[Groonga-commit] groonga/groonga-normalizer-mysql at ec14f85 [master] Add missing 2 right shift for 2 bytes character

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Apr 20 20:22:01 JST 2013


Kouhei Sutou	2013-04-20 20:22:01 +0900 (Sat, 20 Apr 2013)

  New Revision: ec14f85aa16ea690c6847cb45d00ad694185207e
  https://github.com/groonga/groonga-normalizer-mysql/commit/ec14f85aa16ea690c6847cb45d00ad694185207e

  Message:
    Add missing 2 right shift for 2 bytes character
    
    This fixes a bug that 2 bytes chracter is broken after normalization.

  Added files:
    test/suite/general_ci/character_length_2.expected
    test/suite/general_ci/character_length_2.test
    test/suite/unicode_ci/character_length_2.expected
    test/suite/unicode_ci/character_length_2.test
  Modified files:
    normalizers/mysql.c

  Modified: normalizers/mysql.c (+1 -1)
===================================================================
--- normalizers/mysql.c    2013-04-19 14:46:05 +0900 (0a7d511)
+++ normalizers/mysql.c    2013-04-20 20:22:01 +0900 (01a0a69)
@@ -87,7 +87,7 @@ decompose_character(const char *rest, int character_length,
     *low_code = rest[0] & 0x7f;
     break;
   case 2 :
-    *page = rest[0] & 0x1c;
+    *page = (rest[0] & 0x1c) >> 2;
     *low_code = ((rest[0] & 0x03) << 6) + (rest[1] & 0x3f);
     break;
   case 3 :

  Added: test/suite/general_ci/character_length_2.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/suite/general_ci/character_length_2.expected    2013-04-20 20:22:01 +0900 (8218d94)
@@ -0,0 +1,4 @@
+register normalizers/mysql
+[[0,0.0,0.0],true]
+normalize NormalizerMySQLGeneralCI "λογία"
+[[0,0.0,0.0],{"normalized":"ΛΟΓΙΑ","types":[]}]

  Added: test/suite/general_ci/character_length_2.test (+3 -0) 100644
===================================================================
--- /dev/null
+++ test/suite/general_ci/character_length_2.test    2013-04-20 20:22:01 +0900 (9f26b65)
@@ -0,0 +1,3 @@
+register normalizers/mysql
+
+normalize NormalizerMySQLGeneralCI "λογία"

  Added: test/suite/unicode_ci/character_length_2.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/suite/unicode_ci/character_length_2.expected    2013-04-20 20:22:01 +0900 (c60c8cd)
@@ -0,0 +1,4 @@
+register normalizers/mysql
+[[0,0.0,0.0],true]
+normalize NormalizerMySQLUnicodeCI "λογία"
+[[0,0.0,0.0],{"normalized":"ΛΌΓͺΆ","types":[]}]

  Added: test/suite/unicode_ci/character_length_2.test (+3 -0) 100644
===================================================================
--- /dev/null
+++ test/suite/unicode_ci/character_length_2.test    2013-04-20 20:22:01 +0900 (c2bb826)
@@ -0,0 +1,3 @@
+register normalizers/mysql
+
+normalize NormalizerMySQLUnicodeCI "λογία"
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index