From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Subject: Illegal SJIS mapping
Date: Wed, 07 Sep 2016 15:50:50 +0900 (Tokyo Standard Time)
Message-ID: <20160907.155050.233844095.horiguchi.kyotaro@lab.ntt.co.jp> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Hi,
I found an useless entry in utf8_to_sjis.map
> {0xc19c, 0x815f},
which is apparently illegal as UTF-8 which postgresql
deliberately refuses. So it should be removed and the attached
patch does that. 0x815f(SJIS) is also mapped from 0xefbcbc(U+FF3C
FULLWIDTH REVERSE SOLIDUS) and it is a right mapping.
By the way, the file comment at the beginning of UCS_to_SJIS.pl
is the following.
# Generate UTF-8 <--> SJIS code conversion tables from
# map files provided by Unicode organization.
# Unfortunately it is prohibited by the organization
# to distribute the map files. So if you try to use this script,
# you have to obtain SHIFTJIS.TXT from
# the organization's ftp site.
The file was found at the following place thanks to google.
ftp://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
As the URL is showing, or as written in the file
Public/MAPPINGS/EASTASIA/ReadMe.txt, it is already obsolete and
the *live* definition *may* be found in Unicode Character
Database. But I haven't found SJIS-related informatin there.
If I'm not missing anything, the only available authority would
be JIS X 0208/0213 but what should be implmented seems to be
maybe-modified MS932 for which I don't know the authority.
Anyway I ran UCS_to_SJIS.pl with the SHIFTJIS.TXT above and I got
a quite different mapping files from the current ones.
So, I wonder how the mappings related to SJIS (and/or EUC-JP) are
maintained. If no authoritative information is available, the
generating script no longer usable. If any other autority is
choosed, it is to be modified according to whatever the new
source format is.
Any suggestions? Or opinions?
regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:utf8sjis_remove_useless_conversion.patch (text/x-patch, 442B) downloaddiff --git a/src/backend/utils/mb/Unicode/utf8_to_sjis.map b/src/backend/utils/mb/Unicode/utf8_to_sjis.mapindex bcb76c9..47f5fdf 100644--- a/src/backend/utils/mb/Unicode/utf8_to_sjis.map+++ b/src/backend/utils/mb/Unicode/utf8_to_sjis.map@@ -1,5 +1,4 @@-static const pg_utf_to_local ULmapSJIS[ 7398 ] = {- {0xc19c, 0x815f},+static const pg_utf_to_local ULmapSJIS[ 7397 ] = {
{0xc2a2, 0x8191},
{0xc2a3, 0x8192},
{0xc2a5, 0x5c},
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: horiguchi.kyotaro@lab.ntt.co.jp
Subject: Re: Illegal SJIS mapping
In-Reply-To: <20160907.155050.233844095.horiguchi.kyotaro@lab.ntt.co.jp>
References: <20160907.155050.233844095.horiguchi.kyotaro@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox