Improve test for CONVERT() with GB18030 <-> UTF8.

Add a bit of coverage of high code points.

Arjen Nienhuis
pull/14/head
Tom Lane 10 years ago
parent 26df7066cc
commit 199f5973c5
  1. 16
      src/test/regress/expected/conversion.out
  2. 4
      src/test/regress/sql/conversion.sql

@ -523,17 +523,17 @@ SELECT CONVERT('foo', 'UTF8', 'EUC_TW');
(1 row)
-- GB18030 --> UTF8
SELECT CONVERT('foo', 'GB18030', 'UTF8');
convert
---------
foo
SELECT CONVERT('Postgres \247\343\247\335\247\340\247\337 \2249\3138 \317\363 \250\246le\2010\2747phant', 'GB18030', 'UTF8');
convert
-------------------------------------------------------------------------------------------------
Postgres \321\201\320\273\320\276\320\275 \360\237\220\230 \350\261\241 \303\251le\314\201phant
(1 row)
-- UTF8 --> GB18030
SELECT CONVERT('foo', 'UTF8', 'GB18030');
convert
---------
foo
SELECT CONVERT('Postgres \321\201\320\273\320\276\320\275 \360\237\220\230 \350\261\241 \303\251le\314\201phant', 'UTF-8', 'GB18030');
convert
-----------------------------------------------------------------------------------------
Postgres \247\343\247\335\247\340\247\337 \2249\3138 \317\363 \250\246le\2010\2747phant
(1 row)
-- GBK --> UTF8

@ -171,9 +171,9 @@ SELECT CONVERT('foo', 'EUC_TW', 'UTF8');
-- UTF8 --> EUC_TW
SELECT CONVERT('foo', 'UTF8', 'EUC_TW');
-- GB18030 --> UTF8
SELECT CONVERT('foo', 'GB18030', 'UTF8');
SELECT CONVERT('Postgres \247\343\247\335\247\340\247\337 \2249\3138 \317\363 \250\246le\2010\2747phant', 'GB18030', 'UTF8');
-- UTF8 --> GB18030
SELECT CONVERT('foo', 'UTF8', 'GB18030');
SELECT CONVERT('Postgres \321\201\320\273\320\276\320\275 \360\237\220\230 \350\261\241 \303\251le\314\201phant', 'UTF-8', 'GB18030');
-- GBK --> UTF8
SELECT CONVERT('foo', 'GBK', 'UTF8');
-- UTF8 --> GBK

Loading…
Cancel
Save