How to check coding

From: "lms" <piechcio(at)inetcafe(dot)eu(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: How to check coding
Date: 2006-11-22 20:54:11
Message-ID: 20061122205411.M72298@inetcafe.eu.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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;

Browse pgsql-sql by date

  From Date Subject
Next Message Mulham freshcode 2006-11-23 17:19:09 Re: select into
Previous Message Richard Huxton 2006-11-22 19:20:52 Re: Regular Expressions, LIKE, and indexes