Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BBFBA475B3F for ; Sun, 19 May 2002 06:45:04 -0400 (EDT) Received: from www1.translationforge.com (unknown [212.11.36.58]) by postgresql.org (Postfix) with ESMTP id 229D0475876 for ; Sun, 19 May 2002 06:44:57 -0400 (EDT) Received: from linus.translationforge.com ([192.168.1.102]) by www1.translationforge.com (8.12.1/8.12.1) with ESMTP id g4JAj5st023910; Sun, 19 May 2002 12:45:05 +0200 Content-Type: text/plain; charset="iso-8859-15" From: Jean-Michel POURE Reply-To: jm.poure@freesurf.fr To: Patrice =?iso-8859-15?q?H=E9d=E9?= , pgsql-general@postgresql.org Subject: Re: [HACKERS] UTF-8 safe ascii() function Date: Sun, 19 May 2002 12:44:56 +0200 X-Mailer: KMail [version 1.4] References: <200205181853.19420.jm.poure@freesurf.fr> <20020519114413.2265b70e.phede-ml@islande.org> In-Reply-To: <20020519114413.2265b70e.phede-ml@islande.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205191244.56474.jm.poure@freesurf.fr> X-Archive-Number: 200205/651 X-Sequence-Number: 24631 Dear Patrice, Thank you very much. This will save the lives of Java users. > I don't think the function I did is useful as such. It would be better > to make a function that converts the whole string or something. Yes, this would save the lives of some Javascript users. Java Unicode notat= ion=20 is the only Unicode understood by Javascript. > By the way, what is the encoding for Java Unicode ? is it always "\u" > followed by 5 hex digits (in which case your example is wrong) ? Then, > it shouldn't be too difficult to make the relevant function, though I'm > wondering if the Java programme would convert an incoming '\' 'u' '0' > '0' '2' '3' '3' to the corresponding UCS2/UTF16 character ? Java Unicode notation is not case sensitive ('\u' =3D '\U') and is followed= by=20 an hexadecimal value. > Maybe we should have some similar input (and output ?) functionality in > psql, but then I would much prefer the Perl way, which is > \x{hex_digits}, which is unambiguous. This would be perfect. We should also handle the HTML unicode nation : &#{dec_digits} and &#x{hex_digits} as it is unambiguous. Cheers, Jean-Michel