TM format can mix encodings in to_char()
Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
From: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2019-04-12T16:45:51Z
Lists: pgsql-hackers
Attachments
- tm-format-mixes-encodings.patch (application/octet-stream) patch
Hackers, I will use as an example the code in the regression test 'collate.linux.utf8'. There you can find: SET lc_time TO 'tr_TR'; SELECT to_char(date '2010-04-01', 'DD TMMON YYYY'); to_char ------------- 01 NIS 2010 (1 row) The problem is that the locale 'tr_TR' uses the encoding ISO-8859-9 (LATIN5), while the test runs in UTF8. So the following code will raise an error: SET lc_time TO 'tr_TR'; SELECT to_char(date '2010-02-01', 'DD TMMON YYYY'); ERROR: invalid byte sequence for encoding "UTF8": 0xde 0x75 The problem seems to be in the code touched in the attached patch. Regards, Juan Jose Santamaria Flecha
Commits
-
Repair assorted issues in locale data extraction.
- e899df6a24f6 11.3 landed
- c0bafc5e58c5 9.4.22 landed
- 7c02c3f75604 10.8 landed
- 74589026f79f 9.5.17 landed
- 1e5de96629f6 9.6.13 landed
- 7ad1cd31bfcb 12.0 landed