encoding name "SHIFT_JIS" is absent in chklocale.c - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject encoding name "SHIFT_JIS" is absent in chklocale.c
Date
Msg-id 20131214.113505.467339429979746073.t-ishii@sraoss.co.jp
Whole thread Raw
Responses Re: encoding name "SHIFT_JIS" is absent in chklocale.c
List pgsql-hackers
I got a complain from a user.

If current locale is SJIS, psql does not set client encoding to SJIS.

# localedef -f SHIFT_JIS -i ja_JP /usr/lib/locale/ja_JP.SJIS
$ export LANG=ja_JP.SJIS
$ psql
\encoding
SQL_ASCII <-- This should be SJIS

This is because the encoding map (encoding_match_list) in chklocale.c
is lacking the definition for SHIFT_JIS.  Included is a proposed
patch. If there's no objection, I will commit it.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index 8b8862f..3c9d7ab 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -162,6 +162,7 @@ static const struct encoding_match encoding_match_list[] = {    {PG_SJIS, "SJIS"},    {PG_SJIS,
"PCK"},   {PG_SJIS, "CP932"},
 
+    {PG_SJIS, "SHIFT_JIS"},    {PG_BIG5, "BIG5"},    {PG_BIG5, "BIG5HKSCS"},

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Next
From: Gregory Smith
Date:
Subject: Re: [v9.4] row level security