X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C3A00476237 for ; Sat, 10 May 2003 13:36:48 -0400 (EDT) Received: from post.webmailer.de (natsmtp00.webmailer.de [192.67.198.74]) by postgresql.org (Postfix) with ESMTP id BB4B54761BC for ; Sat, 10 May 2003 13:36:47 -0400 (EDT) Received: from iwate.ianb.homelinux.net (pD951768F.dip.t-dialin.net [217.81.118.143]) by post.webmailer.de (8.12.8/8.8.7) with ESMTP id h4AHak0f010907 for ; Sat, 10 May 2003 19:36:46 +0200 (MEST) From: Ian Barwick To: pgsql-sql@postgresql.org Subject: Re: Using psql to insert character codes Date: Sat, 10 May 2003 19:35:55 +0200 User-Agent: KMail/1.5.1 References: <200305101620.24605.barwick@gmx.net> In-Reply-To: <200305101620.24605.barwick@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200305101935.56006.barwick@gmx.net> X-Spam-Status: No, hits=-37.2 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, RCVD_IN_NJABL,RCVD_IN_OSIRUSOFT_COM,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/194 X-Sequence-Number: 13359 On Saturday 10 May 2003 16:20, Ian Barwick wrote: > Say using psql I wish to insert a character into a VARCHAR / TEXT / > whatever column using the its hexadecimal representation in the relevant > character set / encoding. E.g.: C3A4, which represents the character '=C3= =A4' > (lower case a with umlaut) in UTF-8. > > I can do this: > INSERT INTO my_tbl (unitxt) VALUE(encode(decode('c3a4','hex'), 'escape')) correction: INSERT INTO my_tbl (unitxt) VALUES(encode(decode('c3a4','hex'), 'escape')) Ian Barwick barwick@gmx.net