Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 294B89FB20A for ; Wed, 22 Nov 2006 19:36:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 92295-05 for ; Wed, 22 Nov 2006 19:36:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from isb.com.pl (poczta.isb.com.pl [80.48.198.2]) by postgresql.org (Postfix) with ESMTP id 6938A9FB209 for ; Wed, 22 Nov 2006 19:36:51 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by isb.com.pl (Postfix) with ESMTP id C9D5FB13A7 for ; Wed, 22 Nov 2006 21:54:12 +0100 (CET) Received: from isb.com.pl ([127.0.0.1]) by localhost (isb.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12231-09 for ; Wed, 22 Nov 2006 21:54:11 +0100 (CET) Received: from mail.isb.com.pl (localhost.localdomain [127.0.0.1]) by isb.com.pl (Postfix) with ESMTP id 79F30B138E for ; Wed, 22 Nov 2006 21:54:11 +0100 (CET) From: "lms" To: pgsql-sql@postgresql.org Subject: How to check coding Date: Wed, 22 Nov 2006 21:54:11 +0100 Message-Id: <20061122205411.M72298@inetcafe.eu.org> X-Mailer: Open WebMail 2.50 20050106 X-OriginatingIP: 80.48.198.7 (piechcio) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at isb.com.pl X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/235 X-Sequence-Number: 26887 Hi I have a table in SQL_ASCII. Clients with different language versions of Windows can write data in tha table using different coding systems (polish, english, cyrillic). Next i would like to convert each line of given column to UTF8, but each row can use a different coding windows-125*. Who know how can I check coding in this rows with diffrect coding? I tried use iconv and sql command convert, but these commands dont returns any errors and they can convert rows (ex. in windows-1251) from windows-1252 to utf8 whithout any errors, but it is incorrect. For example (in this row data is in windows-1251): SELECT CONVERT((select "2" from langset where id_langset=1),'windows- 1250','UTF8') I got: åäñôôô SELECT CONVERT((select "2" from langset where id_langset=1),'windows- 1251','UTF8') I got: едсффф ICONV: iconv -c -f WINDOWS-1250 -t UTF8 afile ôûâàïñ÷ÿìçåêó iconv -c -f WINDOWS-1251 -t UTF8 a фывапсчямзе ку