X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C5979475CE5 for ; Sat, 10 May 2003 12:15:23 -0400 (EDT) Received: from randalls-laptop.kicks-ass.net (h00062577286a.ne.client2.attbi.com [24.61.43.102]) by postgresql.org (Postfix) with ESMTP id 41BF14758F1 for ; Sat, 10 May 2003 12:15:22 -0400 (EDT) Received: from tercent.net (localhost [127.0.0.1]) by randalls-laptop.kicks-ass.net (8.12.9/8.12.6) with ESMTP id h4AGF8fd013602; Sat, 10 May 2003 12:15:13 -0400 (EDT) Date: Sat, 10 May 2003 12:15:07 -0400 Subject: Re: Using psql to insert character codes Content-Type: text/plain; charset=ISO-8859-1; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: pgsql-sql@postgresql.org To: Ian Barwick From: Randall Lucas In-Reply-To: <200305101620.24605.barwick@gmx.net> Message-Id: <910584EC-8302-11D7-B164-000A957653D6@tercent.net> Content-Transfer-Encoding: quoted-printable X-Mailer: Apple Mail (2.552) X-Spam-Status: No, hits=-28.9 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REPLY_WITH_QUOTES,USER_AGENT_APPLEMAIL 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/192 X-Sequence-Number: 13357 Yes, use a Mac! I'm not being entirely facetious -- if you can use a Mac OS X terminal=20 prompt (and if your pg config is substantially similar to mine),=20 inserting any unicode stuff is quite easy. Simply typing or=20 cutting-and-pasting at the terminal let me visually put in accented=20 Latin, Cyrillic, and Chinese (don't ask me what kind, I am a=20 sinoignoramus) no sweat. Also, Java works well for this -- if you can write or use a Java app to=20 take advantage of its I18N, it will handle the encoding issues via JDBC=20 quite nicely as far as I can tell. Best, Randall 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 /=20 > whatever > column using the its hexadecimal representation in the relevant=20 > character set > / encoding. E.g.: C3A4, which represents the character '=E4' (lower case= =20 > a with > umlaut) in UTF-8. > > I can do this: > INSERT INTO my_tbl (unitxt) VALUE(encode(decode('c3a4','hex'),=20 > 'escape')) > > Is there any other, shorter way of doing the same? > > > Ian Barwick > barwick@gmx.net > > > ---------------------------(end of=20 > broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to=20 > majordomo@postgresql.org) >