X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 594FDD1B19D for ; Mon, 7 Jun 2004 06:16:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61814-02 for ; Mon, 7 Jun 2004 09:16:11 +0000 (GMT) Received: from ara.zf.jcu.cz (ara.zf.jcu.cz [160.217.161.4]) by svr1.postgresql.org (Postfix) with ESMTP id 14A1ED1B1CA for ; Mon, 7 Jun 2004 06:16:08 -0300 (ADT) Received: from ara.zf.jcu.cz (localhost [127.0.0.1]) by nod32.zf.jcu.cz (Postfix) with ESMTP id 39F4E986A; Mon, 7 Jun 2004 11:16:09 +0200 (CEST) X-Virus-Scanner: This message was checked by NOD32 Antivirus system NOD32 for Linux Mail Server. For more information on NOD32 Antivirus System, please, visit our website: http://www.nod32.com/ Received: by ara.zf.jcu.cz (Postfix, from userid 5770) id 195509889; Mon, 7 Jun 2004 11:16:09 +0200 (CEST) Date: Mon, 7 Jun 2004 11:16:08 +0200 From: Karel Zak To: Halley Pacheco de Oliveira Cc: pgsql-docs@postgresql.org Subject: Re: to_ascii function Message-ID: <20040607091608.GE28529@zf.jcu.cz> References: <20040605133915.60539.qmail@web13123.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040605133915.60539.qmail@web13123.mail.yahoo.com> User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/2 X-Sequence-Number: 2400 On Sat, Jun 05, 2004 at 10:39:15AM -0300, Halley Pacheco de Oliveira wrote: > This query didn't work as I was expecting. Any reasons > for that ? > > SELECT TO_ASCII('ΑΙΝΣΪαινσϊ??°') > > result -> 'AEIOUaeioua ' > > I used psql, java and phpPgAdmin without success. > > (PostgreSQL 7.4.2 encoding latin1) Are all chars in your query LATIN1 symbols and are you sure that all used chars have counterpart in ASCII? For this to_ascii() support LATIN1, LATIN2 and WIN1250 only. I'm not sure if there is a way how convert others special chars (for example some Asiatic encodings). # show server_encoding; server_encoding ----------------- LATIN1 # show client_encoding; client_encoding ----------------- LATIN1 # SELECT '>>' || TO_ASCII('ΑΙΝΣΪαινσϊ??°') || '<<'; ?column? ------------------- >>AEIOUaeiou?? << The last char in the string is dec 176 (hex 0xB0). Which char do you expect after conversion to ASCII (0-127)? Karel -- Karel Zak http://home.zf.jcu.cz/~zakkr/