Re: Unicode and unaccent()

From: "Mark Borins" <mark(dot)borins(at)rigadev(dot)com>
To: "'Peter Eisentraut'" <peter_e(at)gmx(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unicode and unaccent()
Date: 2005-05-06 18:01:21
Message-ID: 111540248301@smtp-2.vancouver.ipapp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am not sure how I could encode the characters into UTF-8.

For example, I went to Unicode.org and looked up in the specs for lets say
an â is 00E2. If I wanted to do search for all names with an â in them how
would I do that?

00E2 into Octal is: 342

So would I do:

Select * from table where name like '%\342%'

This leads to a greater question.
I am trying to convert a Unicode DB to Latin1 because I realized we have
absolutely no reason to be using Unicode.

When I try to restore the back of a Unicode database into Latin1 I am
getting some conversion errors as there are characters in Unicode that
cannot be converted automatically into Latin1.

These are erroneous characters and I would like to find them, I am give the
hex value of the offending character. For example, 0x00E2, how would I
search for this character?

Thanks in advance for any help.

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Peter Eisentraut
Sent: May 6, 2005 2:12 AM
To: Mark Borins
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Unicode and unaccent()

Mark Borins wrote:
> My problem is that the values like \342 are for LATIN1 type encoding.
> I have tried and failed to get this working using the what I think
> is the Unicode escaping method \u0032 for example.

There is no Unicode escaping method. You need to encode the characters
into UTF-8 yourself and write out the individual bytes using the octal
escape sequences.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-05-06 18:07:32 Re: Slony v. DBMirror
Previous Message Scott Marlowe 2005-05-06 18:00:22 Re: SQL History