Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2F6D92E0049 for ; Mon, 14 Jan 2008 19:24:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 73137-08 for ; Mon, 14 Jan 2008 19:24:36 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id DEF9F2E2E8B for ; Mon, 14 Jan 2008 19:24:41 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0ENOXcP008279; Mon, 14 Jan 2008 18:24:33 -0500 (EST) To: Joe cc: Medi Montaseri , Steve Midgley , pgsql-sql@postgresql.org Subject: Re: UTF8 encoding and non-text data types In-reply-to: <478BEA35.1010405@freedomcircle.net> References: <20080113222706.73BE416DA2AB@mx1.hub.org> <478aea79.03098c0a.5f32.ffffa6e4SMTPIN_ADDED@mx.google.com> <8078a1730801141101j4bc0dc4chdffee5eaebdb99da@mail.gmail.com> <20080114201831.B34BA2E2CC4@postgresql.org> <8078a1730801141243o63676d02mdb1e3a539679f79f@mail.gmail.com> <7578.1200350483@sss.pgh.pa.us> <478BEA35.1010405@freedomcircle.net> Comments: In-reply-to Joe message dated "Mon, 14 Jan 2008 18:03:17 -0500" Date: Mon, 14 Jan 2008 18:24:33 -0500 Message-ID: <8278.1200353073@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/122 X-Sequence-Number: 29975 Joe writes: > Tom Lane wrote: >> Well, you've got two problems there. The first and biggest is that >> &#NNN; is an HTML notation, not a SQL notation; no SQL database is going >> to think that that string in its input is a representation of a single >> Unicode character. The other problem is that even if this did happen, >> code points 1777 and nearby are not digits; they're something or other >> in Arabic, apparently. >> > Precisely. 1777 through 1780 decimal equate to code points U+06F1 > through U+06F4, which correspond to the Arabic numerals 1 through 4. Oh? Interesting. But even if we wanted to teach Postgres about that, wouldn't there be a pretty strong risk of getting confused by Arabic's right-to-left writing direction? Wouldn't be real helpful if the entry came out as 4321 when the user wanted 1234. Definitely seems like something that had better be left to the application side, where there's more context about what the string means. regards, tom lane