X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 12FFE475CE5 for ; Sat, 10 May 2003 12:54:08 -0400 (EDT) Received: from post.webmailer.de (natsmtp00.webmailer.de [192.67.198.74]) by postgresql.org (Postfix) with ESMTP id 0AE5C4758F1 for ; Sat, 10 May 2003 12:54:07 -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 h4AGsAgu017117; Sat, 10 May 2003 18:54:11 +0200 (MEST) From: Ian Barwick To: Randall Lucas Subject: Re: Using psql to insert character codes Date: Sat, 10 May 2003 18:53:20 +0200 User-Agent: KMail/1.5.1 Cc: pgsql-sql@postgresql.org References: <910584EC-8302-11D7-B164-000A957653D6@tercent.net> In-Reply-To: <910584EC-8302-11D7-B164-000A957653D6@tercent.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200305101853.20266.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/193 X-Sequence-Number: 13358 On Saturday 10 May 2003 18:15, Randall Lucas wrote: > Yes, use a Mac! > > I'm not being entirely facetious -- if you can use a Mac OS X terminal > prompt (and if your pg config is substantially similar to mine), > inserting any unicode stuff is quite easy. Simply typing or > cutting-and-pasting at the terminal let me visually put in accented > Latin, Cyrillic, and Chinese (don't ask me what kind, I am a > sinoignoramus) no sweat. Thanks, but right answer to wrong question ;-). "mlterm" in Linux / FreeBSD= =20 works fine for me; the "problem" is not inputting in general, but the ability to use psql to input using the hexadecimal (or decimal) character code, which I need to do occasionally for some obscure character not reachable by other means. The solution I posted works, I was just wondering whether there was some mo= re=20 elegant method I had overlooked. Ian Barwick barwick@gmx.net > On Saturday, May 10, 2003, at 10:20 AM, 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 '=E4' (lower case > > a with > > umlaut) in UTF-8. > > > > I can do this: > > INSERT INTO my_tbl (unitxt) VALUE(encode(decode('c3a4','hex'), > > 'escape')) > > > > Is there any other, shorter way of doing the same? > > > > > > Ian Barwick > > barwick@gmx.net > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to > > majordomo@postgresql.org)