Consistently use "superuser" instead of "super user"
[pgsql.git] / src / test / regress / expected / conversion.out
blob5c9d63175562c67e36847b5539fecf38d6adf9d4
1 --
2 -- create user defined conversion
3 --
4 CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
5 SET SESSION AUTHORIZATION regress_conversion_user;
6 CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
7 --
8 -- cannot make same name conversion in same schema
9 --
10 CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
11 ERROR:  conversion "myconv" already exists
13 -- create default conversion with qualified name
15 CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
17 -- cannot make default conversion with same schema/for_encoding/to_encoding
19 CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
20 ERROR:  default conversion for LATIN1 to UTF8 already exists
21 -- test comments
22 COMMENT ON CONVERSION myconv_bad IS 'foo';
23 ERROR:  conversion "myconv_bad" does not exist
24 COMMENT ON CONVERSION myconv IS 'bar';
25 COMMENT ON CONVERSION myconv IS NULL;
27 -- drop user defined conversion
29 DROP CONVERSION myconv;
30 DROP CONVERSION mydef;
32 -- Note: the built-in conversions are exercised in opr_sanity.sql,
33 -- so there's no need to do that here.
36 -- return to the superuser
38 RESET SESSION AUTHORIZATION;
39 DROP USER regress_conversion_user;
41 -- Test built-in conversion functions.
43 -- Helper function to test a conversion. Uses the test_enc_conversion function
44 -- that was created in the create_function_0 test.
45 create or replace function test_conv(
46   input IN bytea,
47   src_encoding IN text,
48   dst_encoding IN text,
49   result OUT bytea,
50   errorat OUT bytea,
51   error OUT text)
52 language plpgsql as
54 declare
55   validlen int;
56 begin
57   -- First try to perform the conversion with noError = false. If that errors out,
58   -- capture the error message, and try again with noError = true. The second call
59   -- should succeed and return the position of the error, return that too.
60   begin
61     select * into validlen, result from test_enc_conversion(input, src_encoding, dst_encoding, false);
62     errorat = NULL;
63     error := NULL;
64   exception when others then
65     error := sqlerrm;
66     select * into validlen, result from test_enc_conversion(input, src_encoding, dst_encoding, true);
67     errorat = substr(input, validlen + 1);
68   end;
69   return;
70 end;
71 $$;
73 -- UTF-8
75 CREATE TABLE utf8_inputs (inbytes bytea, description text);
76 insert into utf8_inputs  values
77   ('\x666f6f',          'valid, pure ASCII'),
78   ('\xc3a4c3b6',        'valid, extra latin chars'),
79   ('\xd184d0bed0be',    'valid, cyrillic'),
80   ('\x666f6fe8b1a1',    'valid, kanji/Chinese'),
81   ('\xe382abe3829a',    'valid, two chars that combine to one in EUC_JIS_2004'),
82   ('\xe382ab',          'only first half of combined char in EUC_JIS_2004'),
83   ('\xe382abe382',      'incomplete combination when converted EUC_JIS_2004'),
84   ('\xecbd94eb81bceba6ac', 'valid, Hangul, Korean'),
85   ('\x666f6fefa8aa',    'valid, needs mapping function to convert to GB18030'),
86   ('\x66e8b1ff6f6f',    'invalid byte sequence'),
87   ('\x66006f',          'invalid, NUL byte'),
88   ('\x666f6fe8b100',    'invalid, NUL byte'),
89   ('\x666f6fe8b1',      'incomplete character at end');
90 -- Test UTF-8 verification
91 select description, (test_conv(inbytes, 'utf8', 'utf8')).* from utf8_inputs;
92                      description                      |        result        |   errorat    |                           error                           
93 ------------------------------------------------------+----------------------+--------------+-----------------------------------------------------------
94  valid, pure ASCII                                    | \x666f6f             |              | 
95  valid, extra latin chars                             | \xc3a4c3b6           |              | 
96  valid, cyrillic                                      | \xd184d0bed0be       |              | 
97  valid, kanji/Chinese                                 | \x666f6fe8b1a1       |              | 
98  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       |              | 
99  only first half of combined char in EUC_JIS_2004     | \xe382ab             |              | 
100  incomplete combination when converted EUC_JIS_2004   | \xe382ab             | \xe382       | invalid byte sequence for encoding "UTF8": 0xe3 0x82
101  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac |              | 
102  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       |              | 
103  invalid byte sequence                                | \x66                 | \xe8b1ff6f6f | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
104  invalid, NUL byte                                    | \x66                 | \x006f       | invalid byte sequence for encoding "UTF8": 0x00
105  invalid, NUL byte                                    | \x666f6f             | \xe8b100     | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
106  incomplete character at end                          | \x666f6f             | \xe8b1       | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
107 (13 rows)
109 -- Test conversions from UTF-8
110 select description, inbytes, (test_conv(inbytes, 'utf8', 'euc_jis_2004')).* from utf8_inputs;
111                      description                      |       inbytes        |     result     |       errorat        |                                                    error                                                    
112 ------------------------------------------------------+----------------------+----------------+----------------------+-------------------------------------------------------------------------------------------------------------
113  valid, pure ASCII                                    | \x666f6f             | \x666f6f       |                      | 
114  valid, extra latin chars                             | \xc3a4c3b6           | \xa9daa9ec     |                      | 
115  valid, cyrillic                                      | \xd184d0bed0be       | \xa7e6a7e0a7e0 |                      | 
116  valid, kanji/Chinese                                 | \x666f6fe8b1a1       | \x666f6fbedd   |                      | 
117  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       | \xa5f7         |                      | 
118  only first half of combined char in EUC_JIS_2004     | \xe382ab             | \xa5ab         |                      | 
119  incomplete combination when converted EUC_JIS_2004   | \xe382abe382         | \x             | \xe382abe382         | invalid byte sequence for encoding "UTF8": 0xe3 0x82
120  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac | \x             | \xecbd94eb81bceba6ac | character with byte sequence 0xec 0xbd 0x94 in encoding "UTF8" has no equivalent in encoding "EUC_JIS_2004"
121  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       | \x666f6f       | \xefa8aa             | character with byte sequence 0xef 0xa8 0xaa in encoding "UTF8" has no equivalent in encoding "EUC_JIS_2004"
122  invalid byte sequence                                | \x66e8b1ff6f6f       | \x66           | \xe8b1ff6f6f         | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
123  invalid, NUL byte                                    | \x66006f             | \x66           | \x006f               | invalid byte sequence for encoding "UTF8": 0x00
124  invalid, NUL byte                                    | \x666f6fe8b100       | \x666f6f       | \xe8b100             | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
125  incomplete character at end                          | \x666f6fe8b1         | \x666f6f       | \xe8b1               | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
126 (13 rows)
128 select description, inbytes, (test_conv(inbytes, 'utf8', 'latin1')).* from utf8_inputs;
129                      description                      |       inbytes        |  result  |       errorat        |                                                 error                                                 
130 ------------------------------------------------------+----------------------+----------+----------------------+-------------------------------------------------------------------------------------------------------
131  valid, pure ASCII                                    | \x666f6f             | \x666f6f |                      | 
132  valid, extra latin chars                             | \xc3a4c3b6           | \xe4f6   |                      | 
133  valid, cyrillic                                      | \xd184d0bed0be       | \x       | \xd184d0bed0be       | character with byte sequence 0xd1 0x84 in encoding "UTF8" has no equivalent in encoding "LATIN1"
134  valid, kanji/Chinese                                 | \x666f6fe8b1a1       | \x666f6f | \xe8b1a1             | character with byte sequence 0xe8 0xb1 0xa1 in encoding "UTF8" has no equivalent in encoding "LATIN1"
135  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       | \x       | \xe382abe3829a       | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN1"
136  only first half of combined char in EUC_JIS_2004     | \xe382ab             | \x       | \xe382ab             | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN1"
137  incomplete combination when converted EUC_JIS_2004   | \xe382abe382         | \x       | \xe382abe382         | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN1"
138  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac | \x       | \xecbd94eb81bceba6ac | character with byte sequence 0xec 0xbd 0x94 in encoding "UTF8" has no equivalent in encoding "LATIN1"
139  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       | \x666f6f | \xefa8aa             | character with byte sequence 0xef 0xa8 0xaa in encoding "UTF8" has no equivalent in encoding "LATIN1"
140  invalid byte sequence                                | \x66e8b1ff6f6f       | \x66     | \xe8b1ff6f6f         | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
141  invalid, NUL byte                                    | \x66006f             | \x66     | \x006f               | invalid byte sequence for encoding "UTF8": 0x00
142  invalid, NUL byte                                    | \x666f6fe8b100       | \x666f6f | \xe8b100             | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
143  incomplete character at end                          | \x666f6fe8b1         | \x666f6f | \xe8b1               | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
144 (13 rows)
146 select description, inbytes, (test_conv(inbytes, 'utf8', 'latin2')).* from utf8_inputs;
147                      description                      |       inbytes        |  result  |       errorat        |                                                 error                                                 
148 ------------------------------------------------------+----------------------+----------+----------------------+-------------------------------------------------------------------------------------------------------
149  valid, pure ASCII                                    | \x666f6f             | \x666f6f |                      | 
150  valid, extra latin chars                             | \xc3a4c3b6           | \xe4f6   |                      | 
151  valid, cyrillic                                      | \xd184d0bed0be       | \x       | \xd184d0bed0be       | character with byte sequence 0xd1 0x84 in encoding "UTF8" has no equivalent in encoding "LATIN2"
152  valid, kanji/Chinese                                 | \x666f6fe8b1a1       | \x666f6f | \xe8b1a1             | character with byte sequence 0xe8 0xb1 0xa1 in encoding "UTF8" has no equivalent in encoding "LATIN2"
153  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       | \x       | \xe382abe3829a       | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN2"
154  only first half of combined char in EUC_JIS_2004     | \xe382ab             | \x       | \xe382ab             | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN2"
155  incomplete combination when converted EUC_JIS_2004   | \xe382abe382         | \x       | \xe382abe382         | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN2"
156  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac | \x       | \xecbd94eb81bceba6ac | character with byte sequence 0xec 0xbd 0x94 in encoding "UTF8" has no equivalent in encoding "LATIN2"
157  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       | \x666f6f | \xefa8aa             | character with byte sequence 0xef 0xa8 0xaa in encoding "UTF8" has no equivalent in encoding "LATIN2"
158  invalid byte sequence                                | \x66e8b1ff6f6f       | \x66     | \xe8b1ff6f6f         | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
159  invalid, NUL byte                                    | \x66006f             | \x66     | \x006f               | invalid byte sequence for encoding "UTF8": 0x00
160  invalid, NUL byte                                    | \x666f6fe8b100       | \x666f6f | \xe8b100             | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
161  incomplete character at end                          | \x666f6fe8b1         | \x666f6f | \xe8b1               | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
162 (13 rows)
164 select description, inbytes, (test_conv(inbytes, 'utf8', 'latin5')).* from utf8_inputs;
165                      description                      |       inbytes        |  result  |       errorat        |                                                 error                                                 
166 ------------------------------------------------------+----------------------+----------+----------------------+-------------------------------------------------------------------------------------------------------
167  valid, pure ASCII                                    | \x666f6f             | \x666f6f |                      | 
168  valid, extra latin chars                             | \xc3a4c3b6           | \xe4f6   |                      | 
169  valid, cyrillic                                      | \xd184d0bed0be       | \x       | \xd184d0bed0be       | character with byte sequence 0xd1 0x84 in encoding "UTF8" has no equivalent in encoding "LATIN5"
170  valid, kanji/Chinese                                 | \x666f6fe8b1a1       | \x666f6f | \xe8b1a1             | character with byte sequence 0xe8 0xb1 0xa1 in encoding "UTF8" has no equivalent in encoding "LATIN5"
171  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       | \x       | \xe382abe3829a       | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN5"
172  only first half of combined char in EUC_JIS_2004     | \xe382ab             | \x       | \xe382ab             | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN5"
173  incomplete combination when converted EUC_JIS_2004   | \xe382abe382         | \x       | \xe382abe382         | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "LATIN5"
174  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac | \x       | \xecbd94eb81bceba6ac | character with byte sequence 0xec 0xbd 0x94 in encoding "UTF8" has no equivalent in encoding "LATIN5"
175  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       | \x666f6f | \xefa8aa             | character with byte sequence 0xef 0xa8 0xaa in encoding "UTF8" has no equivalent in encoding "LATIN5"
176  invalid byte sequence                                | \x66e8b1ff6f6f       | \x66     | \xe8b1ff6f6f         | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
177  invalid, NUL byte                                    | \x66006f             | \x66     | \x006f               | invalid byte sequence for encoding "UTF8": 0x00
178  invalid, NUL byte                                    | \x666f6fe8b100       | \x666f6f | \xe8b100             | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
179  incomplete character at end                          | \x666f6fe8b1         | \x666f6f | \xe8b1               | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
180 (13 rows)
182 select description, inbytes, (test_conv(inbytes, 'utf8', 'koi8r')).* from utf8_inputs;
183                      description                      |       inbytes        |  result  |       errorat        |                                                error                                                 
184 ------------------------------------------------------+----------------------+----------+----------------------+------------------------------------------------------------------------------------------------------
185  valid, pure ASCII                                    | \x666f6f             | \x666f6f |                      | 
186  valid, extra latin chars                             | \xc3a4c3b6           | \x       | \xc3a4c3b6           | character with byte sequence 0xc3 0xa4 in encoding "UTF8" has no equivalent in encoding "KOI8R"
187  valid, cyrillic                                      | \xd184d0bed0be       | \xc6cfcf |                      | 
188  valid, kanji/Chinese                                 | \x666f6fe8b1a1       | \x666f6f | \xe8b1a1             | character with byte sequence 0xe8 0xb1 0xa1 in encoding "UTF8" has no equivalent in encoding "KOI8R"
189  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       | \x       | \xe382abe3829a       | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "KOI8R"
190  only first half of combined char in EUC_JIS_2004     | \xe382ab             | \x       | \xe382ab             | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "KOI8R"
191  incomplete combination when converted EUC_JIS_2004   | \xe382abe382         | \x       | \xe382abe382         | character with byte sequence 0xe3 0x82 0xab in encoding "UTF8" has no equivalent in encoding "KOI8R"
192  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac | \x       | \xecbd94eb81bceba6ac | character with byte sequence 0xec 0xbd 0x94 in encoding "UTF8" has no equivalent in encoding "KOI8R"
193  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       | \x666f6f | \xefa8aa             | character with byte sequence 0xef 0xa8 0xaa in encoding "UTF8" has no equivalent in encoding "KOI8R"
194  invalid byte sequence                                | \x66e8b1ff6f6f       | \x66     | \xe8b1ff6f6f         | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
195  invalid, NUL byte                                    | \x66006f             | \x66     | \x006f               | invalid byte sequence for encoding "UTF8": 0x00
196  invalid, NUL byte                                    | \x666f6fe8b100       | \x666f6f | \xe8b100             | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
197  incomplete character at end                          | \x666f6fe8b1         | \x666f6f | \xe8b1               | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
198 (13 rows)
200 select description, inbytes, (test_conv(inbytes, 'utf8', 'gb18030')).* from utf8_inputs;
201                      description                      |       inbytes        |           result           |   errorat    |                           error                           
202 ------------------------------------------------------+----------------------+----------------------------+--------------+-----------------------------------------------------------
203  valid, pure ASCII                                    | \x666f6f             | \x666f6f                   |              | 
204  valid, extra latin chars                             | \xc3a4c3b6           | \x81308a3181308b32         |              | 
205  valid, cyrillic                                      | \xd184d0bed0be       | \xa7e6a7e0a7e0             |              | 
206  valid, kanji/Chinese                                 | \x666f6fe8b1a1       | \x666f6fcff3               |              | 
207  valid, two chars that combine to one in EUC_JIS_2004 | \xe382abe3829a       | \xa5ab8139a732             |              | 
208  only first half of combined char in EUC_JIS_2004     | \xe382ab             | \xa5ab                     |              | 
209  incomplete combination when converted EUC_JIS_2004   | \xe382abe382         | \xa5ab                     | \xe382       | invalid byte sequence for encoding "UTF8": 0xe3 0x82
210  valid, Hangul, Korean                                | \xecbd94eb81bceba6ac | \x8334e5398238c4338330b335 |              | 
211  valid, needs mapping function to convert to GB18030  | \x666f6fefa8aa       | \x666f6f84309c38           |              | 
212  invalid byte sequence                                | \x66e8b1ff6f6f       | \x66                       | \xe8b1ff6f6f | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0xff
213  invalid, NUL byte                                    | \x66006f             | \x66                       | \x006f       | invalid byte sequence for encoding "UTF8": 0x00
214  invalid, NUL byte                                    | \x666f6fe8b100       | \x666f6f                   | \xe8b100     | invalid byte sequence for encoding "UTF8": 0xe8 0xb1 0x00
215  incomplete character at end                          | \x666f6fe8b1         | \x666f6f                   | \xe8b1       | invalid byte sequence for encoding "UTF8": 0xe8 0xb1
216 (13 rows)
219 -- EUC_JIS_2004
221 CREATE TABLE euc_jis_2004_inputs (inbytes bytea, description text);
222 insert into euc_jis_2004_inputs  values
223   ('\x666f6f',          'valid, pure ASCII'),
224   ('\x666f6fbedd',      'valid'),
225   ('\xa5f7',            'valid, translates to two UTF-8 chars '),
226   ('\xbeddbe',          'incomplete char '),
227   ('\x666f6f00bedd',    'invalid, NUL byte'),
228   ('\x666f6fbe00dd',    'invalid, NUL byte'),
229   ('\x666f6fbedd00',    'invalid, NUL byte'),
230   ('\xbe04',            'invalid byte sequence');
231 -- Test EUC_JIS_2004 verification
232 select description, inbytes, (test_conv(inbytes, 'euc_jis_2004', 'euc_jis_2004')).* from euc_jis_2004_inputs;
233               description              |    inbytes     |    result    | errorat  |                            error                             
234 ---------------------------------------+----------------+--------------+----------+--------------------------------------------------------------
235  valid, pure ASCII                     | \x666f6f       | \x666f6f     |          | 
236  valid                                 | \x666f6fbedd   | \x666f6fbedd |          | 
237  valid, translates to two UTF-8 chars  | \xa5f7         | \xa5f7       |          | 
238  incomplete char                       | \xbeddbe       | \xbedd       | \xbe     | invalid byte sequence for encoding "EUC_JIS_2004": 0xbe
239  invalid, NUL byte                     | \x666f6f00bedd | \x666f6f     | \x00bedd | invalid byte sequence for encoding "EUC_JIS_2004": 0x00
240  invalid, NUL byte                     | \x666f6fbe00dd | \x666f6f     | \xbe00dd | invalid byte sequence for encoding "EUC_JIS_2004": 0xbe 0x00
241  invalid, NUL byte                     | \x666f6fbedd00 | \x666f6fbedd | \x00     | invalid byte sequence for encoding "EUC_JIS_2004": 0x00
242  invalid byte sequence                 | \xbe04         | \x           | \xbe04   | invalid byte sequence for encoding "EUC_JIS_2004": 0xbe 0x04
243 (8 rows)
245 -- Test conversions from EUC_JIS_2004
246 select description, inbytes, (test_conv(inbytes, 'euc_jis_2004', 'utf8')).* from euc_jis_2004_inputs;
247               description              |    inbytes     |     result     | errorat  |                            error                             
248 ---------------------------------------+----------------+----------------+----------+--------------------------------------------------------------
249  valid, pure ASCII                     | \x666f6f       | \x666f6f       |          | 
250  valid                                 | \x666f6fbedd   | \x666f6fe8b1a1 |          | 
251  valid, translates to two UTF-8 chars  | \xa5f7         | \xe382abe3829a |          | 
252  incomplete char                       | \xbeddbe       | \xe8b1a1       | \xbe     | invalid byte sequence for encoding "EUC_JIS_2004": 0xbe
253  invalid, NUL byte                     | \x666f6f00bedd | \x666f6f       | \x00bedd | invalid byte sequence for encoding "EUC_JIS_2004": 0x00
254  invalid, NUL byte                     | \x666f6fbe00dd | \x666f6f       | \xbe00dd | invalid byte sequence for encoding "EUC_JIS_2004": 0xbe 0x00
255  invalid, NUL byte                     | \x666f6fbedd00 | \x666f6fe8b1a1 | \x00     | invalid byte sequence for encoding "EUC_JIS_2004": 0x00
256  invalid byte sequence                 | \xbe04         | \x             | \xbe04   | invalid byte sequence for encoding "EUC_JIS_2004": 0xbe 0x04
257 (8 rows)
260 -- SHIFT-JIS-2004
262 CREATE TABLE shiftjis2004_inputs (inbytes bytea, description text);
263 insert into shiftjis2004_inputs  values
264   ('\x666f6f',          'valid, pure ASCII'),
265   ('\x666f6f8fdb',      'valid'),
266   ('\x666f6f81c0',      'valid, no translation to UTF-8'),
267   ('\x666f6f82f5',      'valid, translates to two UTF-8 chars '),
268   ('\x666f6f8fdb8f',    'incomplete char '),
269   ('\x666f6f820a',      'incomplete char, followed by newline '),
270   ('\x666f6f008fdb',    'invalid, NUL byte'),
271   ('\x666f6f8f00db',    'invalid, NUL byte'),
272   ('\x666f6f8fdb00',    'invalid, NUL byte');
273 -- Test SHIFT-JIS-2004 verification
274 select description, inbytes, (test_conv(inbytes, 'shiftjis2004', 'shiftjis2004')).* from shiftjis2004_inputs;
275               description              |    inbytes     |    result    | errorat  |                             error                              
276 ---------------------------------------+----------------+--------------+----------+----------------------------------------------------------------
277  valid, pure ASCII                     | \x666f6f       | \x666f6f     |          | 
278  valid                                 | \x666f6f8fdb   | \x666f6f8fdb |          | 
279  valid, no translation to UTF-8        | \x666f6f81c0   | \x666f6f81c0 |          | 
280  valid, translates to two UTF-8 chars  | \x666f6f82f5   | \x666f6f82f5 |          | 
281  incomplete char                       | \x666f6f8fdb8f | \x666f6f8fdb | \x8f     | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x8f
282  incomplete char, followed by newline  | \x666f6f820a   | \x666f6f     | \x820a   | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x82 0x0a
283  invalid, NUL byte                     | \x666f6f008fdb | \x666f6f     | \x008fdb | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x00
284  invalid, NUL byte                     | \x666f6f8f00db | \x666f6f     | \x8f00db | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x8f 0x00
285  invalid, NUL byte                     | \x666f6f8fdb00 | \x666f6f8fdb | \x00     | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x00
286 (9 rows)
288 -- Test conversions from SHIFT-JIS-2004
289 select description, inbytes, (test_conv(inbytes, 'shiftjis2004', 'utf8')).* from shiftjis2004_inputs;
290               description              |    inbytes     |        result        | errorat  |                             error                              
291 ---------------------------------------+----------------+----------------------+----------+----------------------------------------------------------------
292  valid, pure ASCII                     | \x666f6f       | \x666f6f             |          | 
293  valid                                 | \x666f6f8fdb   | \x666f6fe8b1a1       |          | 
294  valid, no translation to UTF-8        | \x666f6f81c0   | \x666f6fe28a84       |          | 
295  valid, translates to two UTF-8 chars  | \x666f6f82f5   | \x666f6fe3818be3829a |          | 
296  incomplete char                       | \x666f6f8fdb8f | \x666f6fe8b1a1       | \x8f     | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x8f
297  incomplete char, followed by newline  | \x666f6f820a   | \x666f6f             | \x820a   | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x82 0x0a
298  invalid, NUL byte                     | \x666f6f008fdb | \x666f6f             | \x008fdb | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x00
299  invalid, NUL byte                     | \x666f6f8f00db | \x666f6f             | \x8f00db | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x8f 0x00
300  invalid, NUL byte                     | \x666f6f8fdb00 | \x666f6fe8b1a1       | \x00     | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x00
301 (9 rows)
303 select description, inbytes, (test_conv(inbytes, 'shiftjis2004', 'euc_jis_2004')).* from shiftjis2004_inputs;
304               description              |    inbytes     |    result    | errorat  |                             error                              
305 ---------------------------------------+----------------+--------------+----------+----------------------------------------------------------------
306  valid, pure ASCII                     | \x666f6f       | \x666f6f     |          | 
307  valid                                 | \x666f6f8fdb   | \x666f6fbedd |          | 
308  valid, no translation to UTF-8        | \x666f6f81c0   | \x666f6fa2c2 |          | 
309  valid, translates to two UTF-8 chars  | \x666f6f82f5   | \x666f6fa4f7 |          | 
310  incomplete char                       | \x666f6f8fdb8f | \x666f6fbedd | \x8f     | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x8f
311  incomplete char, followed by newline  | \x666f6f820a   | \x666f6f     | \x820a   | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x82 0x0a
312  invalid, NUL byte                     | \x666f6f008fdb | \x666f6f     | \x008fdb | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x00
313  invalid, NUL byte                     | \x666f6f8f00db | \x666f6f     | \x8f00db | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x8f 0x00
314  invalid, NUL byte                     | \x666f6f8fdb00 | \x666f6fbedd | \x00     | invalid byte sequence for encoding "SHIFT_JIS_2004": 0x00
315 (9 rows)
318 -- GB18030
320 CREATE TABLE gb18030_inputs (inbytes bytea, description text);
321 insert into gb18030_inputs  values
322   ('\x666f6f',          'valid, pure ASCII'),
323   ('\x666f6fcff3',      'valid'),
324   ('\x666f6f8431a530',  'valid, no translation to UTF-8'),
325   ('\x666f6f84309c38',  'valid, translates to UTF-8 by mapping function'),
326   ('\x666f6f84309c',    'incomplete char '),
327   ('\x666f6f84309c0a',  'incomplete char, followed by newline '),
328   ('\x666f6f84309c3800', 'invalid, NUL byte'),
329   ('\x666f6f84309c0038', 'invalid, NUL byte');
330 -- Test GB18030 verification
331 select description, inbytes, (test_conv(inbytes, 'gb18030', 'gb18030')).* from gb18030_inputs;
332                   description                   |      inbytes       |      result      |   errorat    |                               error                               
333 ------------------------------------------------+--------------------+------------------+--------------+-------------------------------------------------------------------
334  valid, pure ASCII                              | \x666f6f           | \x666f6f         |              | 
335  valid                                          | \x666f6fcff3       | \x666f6fcff3     |              | 
336  valid, no translation to UTF-8                 | \x666f6f8431a530   | \x666f6f8431a530 |              | 
337  valid, translates to UTF-8 by mapping function | \x666f6f84309c38   | \x666f6f84309c38 |              | 
338  incomplete char                                | \x666f6f84309c     | \x666f6f         | \x84309c     | invalid byte sequence for encoding "GB18030": 0x84 0x30 0x9c
339  incomplete char, followed by newline           | \x666f6f84309c0a   | \x666f6f         | \x84309c0a   | invalid byte sequence for encoding "GB18030": 0x84 0x30 0x9c 0x0a
340  invalid, NUL byte                              | \x666f6f84309c3800 | \x666f6f84309c38 | \x00         | invalid byte sequence for encoding "GB18030": 0x00
341  invalid, NUL byte                              | \x666f6f84309c0038 | \x666f6f         | \x84309c0038 | invalid byte sequence for encoding "GB18030": 0x84 0x30 0x9c 0x00
342 (8 rows)
344 -- Test conversions from GB18030
345 select description, inbytes, (test_conv(inbytes, 'gb18030', 'utf8')).* from gb18030_inputs;
346                   description                   |      inbytes       |     result     |   errorat    |                                                    error                                                    
347 ------------------------------------------------+--------------------+----------------+--------------+-------------------------------------------------------------------------------------------------------------
348  valid, pure ASCII                              | \x666f6f           | \x666f6f       |              | 
349  valid                                          | \x666f6fcff3       | \x666f6fe8b1a1 |              | 
350  valid, no translation to UTF-8                 | \x666f6f8431a530   | \x666f6f       | \x8431a530   | character with byte sequence 0x84 0x31 0xa5 0x30 in encoding "GB18030" has no equivalent in encoding "UTF8"
351  valid, translates to UTF-8 by mapping function | \x666f6f84309c38   | \x666f6fefa8aa |              | 
352  incomplete char                                | \x666f6f84309c     | \x666f6f       | \x84309c     | invalid byte sequence for encoding "GB18030": 0x84 0x30 0x9c
353  incomplete char, followed by newline           | \x666f6f84309c0a   | \x666f6f       | \x84309c0a   | invalid byte sequence for encoding "GB18030": 0x84 0x30 0x9c 0x0a
354  invalid, NUL byte                              | \x666f6f84309c3800 | \x666f6fefa8aa | \x00         | invalid byte sequence for encoding "GB18030": 0x00
355  invalid, NUL byte                              | \x666f6f84309c0038 | \x666f6f       | \x84309c0038 | invalid byte sequence for encoding "GB18030": 0x84 0x30 0x9c 0x00
356 (8 rows)
359 -- ISO-8859-5
361 CREATE TABLE iso8859_5_inputs (inbytes bytea, description text);
362 insert into iso8859_5_inputs  values
363   ('\x666f6f',          'valid, pure ASCII'),
364   ('\xe4dede',          'valid'),
365   ('\x00',              'invalid, NUL byte'),
366   ('\xe400dede',        'invalid, NUL byte'),
367   ('\xe4dede00',        'invalid, NUL byte');
368 -- Test ISO-8859-5 verification
369 select description, inbytes, (test_conv(inbytes, 'iso8859-5', 'iso8859-5')).* from iso8859_5_inputs;
370     description    |  inbytes   |  result  | errorat  |                         error                         
371 -------------------+------------+----------+----------+-------------------------------------------------------
372  valid, pure ASCII | \x666f6f   | \x666f6f |          | 
373  valid             | \xe4dede   | \xe4dede |          | 
374  invalid, NUL byte | \x00       | \x       | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
375  invalid, NUL byte | \xe400dede | \xe4     | \x00dede | invalid byte sequence for encoding "ISO_8859_5": 0x00
376  invalid, NUL byte | \xe4dede00 | \xe4dede | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
377 (5 rows)
379 -- Test conversions from ISO-8859-5
380 select description, inbytes, (test_conv(inbytes, 'iso8859-5', 'utf8')).* from iso8859_5_inputs;
381     description    |  inbytes   |     result     | errorat  |                         error                         
382 -------------------+------------+----------------+----------+-------------------------------------------------------
383  valid, pure ASCII | \x666f6f   | \x666f6f       |          | 
384  valid             | \xe4dede   | \xd184d0bed0be |          | 
385  invalid, NUL byte | \x00       | \x             | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
386  invalid, NUL byte | \xe400dede | \xd184         | \x00dede | invalid byte sequence for encoding "ISO_8859_5": 0x00
387  invalid, NUL byte | \xe4dede00 | \xd184d0bed0be | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
388 (5 rows)
390 select description, inbytes, (test_conv(inbytes, 'iso8859-5', 'koi8r')).* from iso8859_5_inputs;
391     description    |  inbytes   |  result  | errorat  |                         error                         
392 -------------------+------------+----------+----------+-------------------------------------------------------
393  valid, pure ASCII | \x666f6f   | \x666f6f |          | 
394  valid             | \xe4dede   | \xc6cfcf |          | 
395  invalid, NUL byte | \x00       | \x       | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
396  invalid, NUL byte | \xe400dede | \xc6     | \x00dede | invalid byte sequence for encoding "ISO_8859_5": 0x00
397  invalid, NUL byte | \xe4dede00 | \xc6cfcf | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
398 (5 rows)
400 select description, inbytes, (test_conv(inbytes, 'iso8859_5', 'mule_internal')).* from iso8859_5_inputs;
401     description    |  inbytes   |     result     | errorat  |                         error                         
402 -------------------+------------+----------------+----------+-------------------------------------------------------
403  valid, pure ASCII | \x666f6f   | \x666f6f       |          | 
404  valid             | \xe4dede   | \x8bc68bcf8bcf |          | 
405  invalid, NUL byte | \x00       | \x             | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
406  invalid, NUL byte | \xe400dede | \x8bc6         | \x00dede | invalid byte sequence for encoding "ISO_8859_5": 0x00
407  invalid, NUL byte | \xe4dede00 | \x8bc68bcf8bcf | \x00     | invalid byte sequence for encoding "ISO_8859_5": 0x00
408 (5 rows)
411 -- Big5
413 CREATE TABLE big5_inputs (inbytes bytea, description text);
414 insert into big5_inputs  values
415   ('\x666f6f',          'valid, pure ASCII'),
416   ('\x666f6fb648',      'valid'),
417   ('\x666f6fa27f',      'valid, no translation to UTF-8'),
418   ('\x666f6fb60048',    'invalid, NUL byte'),
419   ('\x666f6fb64800',    'invalid, NUL byte');
420 -- Test Big5 verification
421 select description, inbytes, (test_conv(inbytes, 'big5', 'big5')).* from big5_inputs;
422           description           |    inbytes     |    result    | errorat  |                        error                         
423 --------------------------------+----------------+--------------+----------+------------------------------------------------------
424  valid, pure ASCII              | \x666f6f       | \x666f6f     |          | 
425  valid                          | \x666f6fb648   | \x666f6fb648 |          | 
426  valid, no translation to UTF-8 | \x666f6fa27f   | \x666f6fa27f |          | 
427  invalid, NUL byte              | \x666f6fb60048 | \x666f6f     | \xb60048 | invalid byte sequence for encoding "BIG5": 0xb6 0x00
428  invalid, NUL byte              | \x666f6fb64800 | \x666f6fb648 | \x00     | invalid byte sequence for encoding "BIG5": 0x00
429 (5 rows)
431 -- Test conversions from Big5
432 select description, inbytes, (test_conv(inbytes, 'big5', 'utf8')).* from big5_inputs;
433           description           |    inbytes     |     result     | errorat  |                                             error                                              
434 --------------------------------+----------------+----------------+----------+------------------------------------------------------------------------------------------------
435  valid, pure ASCII              | \x666f6f       | \x666f6f       |          | 
436  valid                          | \x666f6fb648   | \x666f6fe8b1a1 |          | 
437  valid, no translation to UTF-8 | \x666f6fa27f   | \x666f6f       | \xa27f   | character with byte sequence 0xa2 0x7f in encoding "BIG5" has no equivalent in encoding "UTF8"
438  invalid, NUL byte              | \x666f6fb60048 | \x666f6f       | \xb60048 | invalid byte sequence for encoding "BIG5": 0xb6 0x00
439  invalid, NUL byte              | \x666f6fb64800 | \x666f6fe8b1a1 | \x00     | invalid byte sequence for encoding "BIG5": 0x00
440 (5 rows)
442 select description, inbytes, (test_conv(inbytes, 'big5', 'mule_internal')).* from big5_inputs;
443           description           |    inbytes     |     result     | errorat  |                        error                         
444 --------------------------------+----------------+----------------+----------+------------------------------------------------------
445  valid, pure ASCII              | \x666f6f       | \x666f6f       |          | 
446  valid                          | \x666f6fb648   | \x666f6f95e2af |          | 
447  valid, no translation to UTF-8 | \x666f6fa27f   | \x666f6f95a3c1 |          | 
448  invalid, NUL byte              | \x666f6fb60048 | \x666f6f       | \xb60048 | invalid byte sequence for encoding "BIG5": 0xb6 0x00
449  invalid, NUL byte              | \x666f6fb64800 | \x666f6f95e2af | \x00     | invalid byte sequence for encoding "BIG5": 0x00
450 (5 rows)
453 -- MULE_INTERNAL
455 CREATE TABLE mic_inputs (inbytes bytea, description text);
456 insert into mic_inputs  values
457   ('\x666f6f',          'valid, pure ASCII'),
458   ('\x8bc68bcf8bcf',    'valid (in KOI8R)'),
459   ('\x8bc68bcf8b',      'invalid,incomplete char'),
460   ('\x92bedd',          'valid (in SHIFT_JIS)'),
461   ('\x92be',            'invalid, incomplete char)'),
462   ('\x666f6f95a3c1',    'valid (in Big5)'),
463   ('\x666f6f95a3',      'invalid, incomplete char'),
464   ('\x9200bedd',        'invalid, NUL byte'),
465   ('\x92bedd00',        'invalid, NUL byte'),
466   ('\x8b00c68bcf8bcf',  'invalid, NUL byte');
467 -- Test MULE_INTERNAL verification
468 select description, inbytes, (test_conv(inbytes, 'mule_internal', 'mule_internal')).* from mic_inputs;
469         description        |     inbytes      |     result     |     errorat      |                               error                                
470 ---------------------------+------------------+----------------+------------------+--------------------------------------------------------------------
471  valid, pure ASCII         | \x666f6f         | \x666f6f       |                  | 
472  valid (in KOI8R)          | \x8bc68bcf8bcf   | \x8bc68bcf8bcf |                  | 
473  invalid,incomplete char   | \x8bc68bcf8b     | \x8bc68bcf     | \x8b             | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b
474  valid (in SHIFT_JIS)      | \x92bedd         | \x92bedd       |                  | 
475  invalid, incomplete char) | \x92be           | \x             | \x92be           | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0xbe
476  valid (in Big5)           | \x666f6f95a3c1   | \x666f6f95a3c1 |                  | 
477  invalid, incomplete char  | \x666f6f95a3     | \x666f6f       | \x95a3           | invalid byte sequence for encoding "MULE_INTERNAL": 0x95 0xa3
478  invalid, NUL byte         | \x9200bedd       | \x             | \x9200bedd       | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0x00 0xbe
479  invalid, NUL byte         | \x92bedd00       | \x92bedd       | \x00             | invalid byte sequence for encoding "MULE_INTERNAL": 0x00
480  invalid, NUL byte         | \x8b00c68bcf8bcf | \x             | \x8b00c68bcf8bcf | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b 0x00
481 (10 rows)
483 -- Test conversions from MULE_INTERNAL
484 select description, inbytes, (test_conv(inbytes, 'mule_internal', 'koi8r')).* from mic_inputs;
485         description        |     inbytes      |  result  |     errorat      |                                                     error                                                     
486 ---------------------------+------------------+----------+------------------+---------------------------------------------------------------------------------------------------------------
487  valid, pure ASCII         | \x666f6f         | \x666f6f |                  | 
488  valid (in KOI8R)          | \x8bc68bcf8bcf   | \xc6cfcf |                  | 
489  invalid,incomplete char   | \x8bc68bcf8b     | \xc6cf   | \x8b             | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b
490  valid (in SHIFT_JIS)      | \x92bedd         | \x       | \x92bedd         | character with byte sequence 0x92 0xbe 0xdd in encoding "MULE_INTERNAL" has no equivalent in encoding "KOI8R"
491  invalid, incomplete char) | \x92be           | \x       | \x92be           | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0xbe
492  valid (in Big5)           | \x666f6f95a3c1   | \x666f6f | \x95a3c1         | character with byte sequence 0x95 0xa3 0xc1 in encoding "MULE_INTERNAL" has no equivalent in encoding "KOI8R"
493  invalid, incomplete char  | \x666f6f95a3     | \x666f6f | \x95a3           | invalid byte sequence for encoding "MULE_INTERNAL": 0x95 0xa3
494  invalid, NUL byte         | \x9200bedd       | \x       | \x9200bedd       | character with byte sequence 0x92 0x00 0xbe in encoding "MULE_INTERNAL" has no equivalent in encoding "KOI8R"
495  invalid, NUL byte         | \x92bedd00       | \x       | \x92bedd00       | character with byte sequence 0x92 0xbe 0xdd in encoding "MULE_INTERNAL" has no equivalent in encoding "KOI8R"
496  invalid, NUL byte         | \x8b00c68bcf8bcf | \x       | \x8b00c68bcf8bcf | character with byte sequence 0x8b 0x00 in encoding "MULE_INTERNAL" has no equivalent in encoding "KOI8R"
497 (10 rows)
499 select description, inbytes, (test_conv(inbytes, 'mule_internal', 'iso8859-5')).* from mic_inputs;
500         description        |     inbytes      |  result  |     errorat      |                                                       error                                                        
501 ---------------------------+------------------+----------+------------------+--------------------------------------------------------------------------------------------------------------------
502  valid, pure ASCII         | \x666f6f         | \x666f6f |                  | 
503  valid (in KOI8R)          | \x8bc68bcf8bcf   | \xe4dede |                  | 
504  invalid,incomplete char   | \x8bc68bcf8b     | \xe4de   | \x8b             | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b
505  valid (in SHIFT_JIS)      | \x92bedd         | \x       | \x92bedd         | character with byte sequence 0x92 0xbe 0xdd in encoding "MULE_INTERNAL" has no equivalent in encoding "ISO_8859_5"
506  invalid, incomplete char) | \x92be           | \x       | \x92be           | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0xbe
507  valid (in Big5)           | \x666f6f95a3c1   | \x666f6f | \x95a3c1         | character with byte sequence 0x95 0xa3 0xc1 in encoding "MULE_INTERNAL" has no equivalent in encoding "ISO_8859_5"
508  invalid, incomplete char  | \x666f6f95a3     | \x666f6f | \x95a3           | invalid byte sequence for encoding "MULE_INTERNAL": 0x95 0xa3
509  invalid, NUL byte         | \x9200bedd       | \x       | \x9200bedd       | character with byte sequence 0x92 0x00 0xbe in encoding "MULE_INTERNAL" has no equivalent in encoding "ISO_8859_5"
510  invalid, NUL byte         | \x92bedd00       | \x       | \x92bedd00       | character with byte sequence 0x92 0xbe 0xdd in encoding "MULE_INTERNAL" has no equivalent in encoding "ISO_8859_5"
511  invalid, NUL byte         | \x8b00c68bcf8bcf | \x       | \x8b00c68bcf8bcf | character with byte sequence 0x8b 0x00 in encoding "MULE_INTERNAL" has no equivalent in encoding "ISO_8859_5"
512 (10 rows)
514 select description, inbytes, (test_conv(inbytes, 'mule_internal', 'sjis')).* from mic_inputs;
515         description        |     inbytes      |  result  |     errorat      |                                                    error                                                     
516 ---------------------------+------------------+----------+------------------+--------------------------------------------------------------------------------------------------------------
517  valid, pure ASCII         | \x666f6f         | \x666f6f |                  | 
518  valid (in KOI8R)          | \x8bc68bcf8bcf   | \x       | \x8bc68bcf8bcf   | character with byte sequence 0x8b 0xc6 in encoding "MULE_INTERNAL" has no equivalent in encoding "SJIS"
519  invalid,incomplete char   | \x8bc68bcf8b     | \x       | \x8bc68bcf8b     | character with byte sequence 0x8b 0xc6 in encoding "MULE_INTERNAL" has no equivalent in encoding "SJIS"
520  valid (in SHIFT_JIS)      | \x92bedd         | \x8fdb   |                  | 
521  invalid, incomplete char) | \x92be           | \x       | \x92be           | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0xbe
522  valid (in Big5)           | \x666f6f95a3c1   | \x666f6f | \x95a3c1         | character with byte sequence 0x95 0xa3 0xc1 in encoding "MULE_INTERNAL" has no equivalent in encoding "SJIS"
523  invalid, incomplete char  | \x666f6f95a3     | \x666f6f | \x95a3           | invalid byte sequence for encoding "MULE_INTERNAL": 0x95 0xa3
524  invalid, NUL byte         | \x9200bedd       | \x       | \x9200bedd       | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0x00 0xbe
525  invalid, NUL byte         | \x92bedd00       | \x8fdb   | \x00             | invalid byte sequence for encoding "MULE_INTERNAL": 0x00
526  invalid, NUL byte         | \x8b00c68bcf8bcf | \x       | \x8b00c68bcf8bcf | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b 0x00
527 (10 rows)
529 select description, inbytes, (test_conv(inbytes, 'mule_internal', 'big5')).* from mic_inputs;
530         description        |     inbytes      |    result    |     errorat      |                                                    error                                                     
531 ---------------------------+------------------+--------------+------------------+--------------------------------------------------------------------------------------------------------------
532  valid, pure ASCII         | \x666f6f         | \x666f6f     |                  | 
533  valid (in KOI8R)          | \x8bc68bcf8bcf   | \x           | \x8bc68bcf8bcf   | character with byte sequence 0x8b 0xc6 in encoding "MULE_INTERNAL" has no equivalent in encoding "BIG5"
534  invalid,incomplete char   | \x8bc68bcf8b     | \x           | \x8bc68bcf8b     | character with byte sequence 0x8b 0xc6 in encoding "MULE_INTERNAL" has no equivalent in encoding "BIG5"
535  valid (in SHIFT_JIS)      | \x92bedd         | \x           | \x92bedd         | character with byte sequence 0x92 0xbe 0xdd in encoding "MULE_INTERNAL" has no equivalent in encoding "BIG5"
536  invalid, incomplete char) | \x92be           | \x           | \x92be           | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0xbe
537  valid (in Big5)           | \x666f6f95a3c1   | \x666f6fa2a1 |                  | 
538  invalid, incomplete char  | \x666f6f95a3     | \x666f6f     | \x95a3           | invalid byte sequence for encoding "MULE_INTERNAL": 0x95 0xa3
539  invalid, NUL byte         | \x9200bedd       | \x           | \x9200bedd       | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0x00 0xbe
540  invalid, NUL byte         | \x92bedd00       | \x           | \x92bedd00       | character with byte sequence 0x92 0xbe 0xdd in encoding "MULE_INTERNAL" has no equivalent in encoding "BIG5"
541  invalid, NUL byte         | \x8b00c68bcf8bcf | \x           | \x8b00c68bcf8bcf | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b 0x00
542 (10 rows)
544 select description, inbytes, (test_conv(inbytes, 'mule_internal', 'euc_jp')).* from mic_inputs;
545         description        |     inbytes      |  result  |     errorat      |                                                     error                                                      
546 ---------------------------+------------------+----------+------------------+----------------------------------------------------------------------------------------------------------------
547  valid, pure ASCII         | \x666f6f         | \x666f6f |                  | 
548  valid (in KOI8R)          | \x8bc68bcf8bcf   | \x       | \x8bc68bcf8bcf   | character with byte sequence 0x8b 0xc6 in encoding "MULE_INTERNAL" has no equivalent in encoding "EUC_JP"
549  invalid,incomplete char   | \x8bc68bcf8b     | \x       | \x8bc68bcf8b     | character with byte sequence 0x8b 0xc6 in encoding "MULE_INTERNAL" has no equivalent in encoding "EUC_JP"
550  valid (in SHIFT_JIS)      | \x92bedd         | \xbedd   |                  | 
551  invalid, incomplete char) | \x92be           | \x       | \x92be           | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0xbe
552  valid (in Big5)           | \x666f6f95a3c1   | \x666f6f | \x95a3c1         | character with byte sequence 0x95 0xa3 0xc1 in encoding "MULE_INTERNAL" has no equivalent in encoding "EUC_JP"
553  invalid, incomplete char  | \x666f6f95a3     | \x666f6f | \x95a3           | invalid byte sequence for encoding "MULE_INTERNAL": 0x95 0xa3
554  invalid, NUL byte         | \x9200bedd       | \x       | \x9200bedd       | invalid byte sequence for encoding "MULE_INTERNAL": 0x92 0x00 0xbe
555  invalid, NUL byte         | \x92bedd00       | \xbedd   | \x00             | invalid byte sequence for encoding "MULE_INTERNAL": 0x00
556  invalid, NUL byte         | \x8b00c68bcf8bcf | \x       | \x8b00c68bcf8bcf | invalid byte sequence for encoding "MULE_INTERNAL": 0x8b 0x00
557 (10 rows)