Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XEsaL-0000ji-JY for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Aug 2014 04:12:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XEsaK-0002fY-VG for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Aug 2014 04:12:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XEsaJ-0002fR-US for pgsql-bugs@postgresql.org; Wed, 06 Aug 2014 04:12:20 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XEsaF-0001o7-Om for pgsql-bugs@postgresql.org; Wed, 06 Aug 2014 04:12:17 +0000 Received: from ayaki.localdomain (58-7-183-163.dyn.iinet.net.au [58.7.183.163]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0LjaMC-1Whjgf0oyu-00bbqK; Wed, 06 Aug 2014 06:12:10 +0200 Message-ID: <53E1AB15.8050702@2ndquadrant.com> Date: Wed, 06 Aug 2014 12:12:05 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs Subject: Re: PostgreSQL fails to convert decomposed utf-8 to other encodings References: <53E179E1.3060404@2ndquadrant.com> <1523.1407287675@sss.pgh.pa.us> <53E1A6F8.1000104@2ndquadrant.com> In-Reply-To: <53E1A6F8.1000104@2ndquadrant.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:G9Tdpv+DsXGxKPRxipYDDQjHmhhN/GzZVJTk3uI7u+Q AtUGGLPtuE/D+apGNbNQn4hNoY1C+0v03tJl63RAPWp+uxmCIV /yLL51EpRTCPbTJMVjbJ1/Btjh5Ff0kSyXiZu9C+ydD2Ek8cmq VOtEfXshUUG5eYiDwsUyLfIpR36aktVZ0pPZS9Vgp8kgK1WpWM oLMcv++GPUntAJ+4EV7Bc1bXmtepUD+mlSckRGw8SGs6CXv8Xz jzSMedjoc0+fBSUBHAwpvZNEDDnLfY17bdwpPckW22mMraceff KcFqnynhHIlMz7vvJiiTpDXzmsiokDQPGSjFg5MCiSDO0XKecv ZEuR3JB9mv0zjfL3gUQ7Vhmjer8O3qQ+218uelx+p X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 08/06/2014 11:54 AM, Craig Ringer wrote: > On 08/06/2014 09:14 AM, Tom Lane wrote: >> We don't actually support "decomposed" utf8; if there is any bug here, >> it's that the input you show isn't rejected. But I think there was >> some intentional choice to not check \u escapes fully. > > Combining characters (i.e. decomposed utf-8 form, for chars where there > is a combined equivalent) are part of utf-8. They're not an optional add-on. ... though we can advertise partial Unicode support, saying that we support UTF-8 for UCS (ISO 10646-1:2000 Annex D / RFC 3629) implementation level 1 only, requiring Normalization Form C (NFC) input. Given that Pg doesn't seem to understand \xf8 or \xfc utf-8 chars, so it doesn't cover the full utf-8 range, it doesn't look like it meets Level 1 either. So it supports "mostly-utf8". With level 1 we should really _reject_ combining chars, but can't do that w/o breaking BC. I guess I should turn this: http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt into a regression test. Possibly also parts of this: http://www.columbia.edu/~fdc/utf8/ though it's more oriented toward rendering. It's worth noting that Konsole and Thunderbird had no issues with combining chars when I was testing this. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs