pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: [SPAM]-D] How to find broken UTF-8 characters ?
Date: 30 Apr 2010 10:21:03 GMT
Message-ID: <hreauf$cma$1@reversiblemaps.ath.cx> (raw)
References: <4BD4DA7B.3000603@gmx.net>
	<4BD5670A.803@bankir.ru>
	<4BD58A00.7030905@gmx.net>
	<4BD835AD.2050902@magwerks.com>
	<4BD8F038.6060601@gmx.net>

On 2010-04-29, Andreas <maps.on@gmx.net> wrote:
> Hi,
>
> while writing the reply below I found it sounds like beeing OT but it's 
> actually not.
> I just need a way to check if a collumn contains values that CAN NOT be 
> converted from Utf8 to Latin1.
> I tried:
> Select convert_to (my_column::text, 'LATIN1') from my_table;
>
> It raises an error that says translated:
> ERROR:  character 0xe28093 in encoding »UTF8« has no equivalent in »LATIN1«

use a regular expression.

 ISO8859-1 is easy, all the caracters a grouped together in unicode so
the regular expression consists of a single inverted range class

 SELECT pkey FROM tabname 
 WHERE ( textfield || textfiled2 || textfield3 ) ~ ('[^'||chr(1)||'-'||chr(255)||']');




view thread (6+ messages)  latest in thread

Message-ID: <hreauf$cma$1@reversiblemaps.ath.cx>
Permalink:  ../hreauf$cma$1@reversiblemaps.ath.cx/
Also on:    postgresql.org/message-id/hreauf$cma$1@reversiblemaps.ath.cx

 · 

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: jasen@xnet.co.nz
  Subject: Re: [SPAM]-D] How to find broken UTF-8 characters ?
  In-Reply-To: <hreauf$cma$1@reversiblemaps.ath.cx>

* 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