pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lms <piechcio@inetcafe.eu.org>
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> (raw)

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: &#1077;&#1076;&#1089;&#1092;&#1092;&#1092;

ICONV:
iconv -c -f WINDOWS-1250 -t UTF8 afile
ôűâŕďń÷˙ěçĺęó

iconv -c -f WINDOWS-1251 -t UTF8 a
&#1092;&#1099;&#1074;&#1072;&#1087;&#1089;&#1095;&#1103;&#1084;&#1079;&#1077;
&#1082;&#1091;




Message-ID: <20061122205411.M72298@inetcafe.eu.org>
Permalink:  ../20061122205411.M72298@inetcafe.eu.org/
Also on:    postgresql.org/message-id/20061122205411.M72298@inetcafe.eu.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: piechcio@inetcafe.eu.org
  Subject: Re: How to check coding
  In-Reply-To: <20061122205411.M72298@inetcafe.eu.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox