Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YVRmo-0001Fh-5h for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Mar 2015 21:33:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YVRmn-0000vk-KX for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Mar 2015 21:33:57 +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 1YVRmm-0000vZ-QB for pgsql-bugs@postgresql.org; Tue, 10 Mar 2015 21:33:56 +0000 Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YVRmi-0007JT-IE for pgsql-bugs@postgresql.org; Tue, 10 Mar 2015 21:33:54 +0000 Received: by lbdu14 with SMTP id u14so4856785lbd.0 for ; Tue, 10 Mar 2015 14:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9HNIuPq/HSOOlJDUql7rTU5zkME5aqMY4+29ebVrGyY=; b=puSJ+PIJ1ggyNeNeQpTEPd2N4yIWCIDXQ63VyTLgGpmh3DatxQw7gvUQqO0MK073ae eSS9cheFnqI1vRTW+Swh0LsUaHYXexWmDvdlHB9t2JdhSeJw8YgRFw9x1uMYY7flFsJn Is4aZy0e6czfknOUXWQcvdE/Uh5ZKR3dde8xD/I2wTGg3PDyeEM3mkSoWG0MI/3HWx9x OTiJ87k9a+sdSVfpwznj7h4kDhPU1k7uZ99+oW81jhk7vdQtQbTxzaS7avh05oHS2otQ c8FI2/K/pGm4JxPNaNRMGnefxfULZfAvCVWizsbWLISl+wqw+uKYUDmJxY7EBaVSlTNS ovFA== X-Received: by 10.152.87.199 with SMTP id ba7mr26389755lab.75.1426023230720; Tue, 10 Mar 2015 14:33:50 -0700 (PDT) Received: from [10.43.4.179] ([212.98.78.41]) by mx.google.com with ESMTPSA id iy9sm348201lbc.8.2015.03.10.14.33.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 14:33:49 -0700 (PDT) Message-ID: <54FF633B.9090006@iki.fi> Date: Tue, 10 Mar 2015 23:33:47 +0200 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: a.g.nienhuis@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #12845: The GB18030 encoding doesn't support Unicode characters over 0xFFFF References: <20150309205145.4031.32069@wrigleys.postgresql.org> In-Reply-To: <20150309205145.4031.32069@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) 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 03/09/2015 10:51 PM, a.g.nienhuis@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 12845 > Logged by: Arjen Nienhuis > Email address: a.g.nienhuis@gmail.com > PostgreSQL version: 9.3.5 > Operating system: Ubuntu Linux > Description: > > Step to reproduce: > > In psql: > > arjen=> select convert_to(chr(128512), 'GB18030'); > > Actual output: > > ERROR: character with byte sequence 0xf0 0x9f 0x98 0x80 in encoding "UTF8" > has no equivalent in encoding "GB18030" > > Expected output: > > convert_to > ------------ > \x9439fc36 > (1 row) Hmm, looks like our gb18030 <-> Unicode conversion table only contains the Unicode BMP plane. Unicode points above 0xffff are not included. If we added all the missing mappings as one to one mappings, like we've done for the BMP, that would bloat the table horribly. There are over 1 million code points that are currently not mapped. Fortunately, the missing mappings are in linear ranges that would be fairly simple to handle in programmatically. See e.g. https://ssl.icu-project.org/repos/icu/data/trunk/charset/source/gb18030/gb18030.html. Someone needs to write the code (I'm not volunteering myself). - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs