Commit 199f5973 authored by Tom Lane's avatar Tom Lane

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

Add a bit of coverage of high code points.

Arjen Nienhuis
parent 26df7066
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment