Convert text from UTF8 to ASCII

From: "Paul Dam" <p(dot)dam(at)amyyon(dot)nl>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Convert text from UTF8 to ASCII
Date: 2009-03-11 15:04:42
Message-ID: 28DD271C986F234A9B4573938292C1B31BD704@s0008.a-more.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hoi,

I store content of an .txt file in a text column in the database.

server_encoding is UTF8.

If the .txt file is in ASCII this is correctly stored in the database.

If the .txt file is in UTF8 this is NOT correctly stored in the database.

Examples:

In Dutch the term for patient is 'patiënt'.

It is stored as 'patiënt'.

The first line of the .txt file is 'AAAAAAAAAAAA'.

It is stored as 'AAAAAAAAAAAA'.

How can I convert patiënt into patiënt?

Or more precise: How can I convert the text column to the correct format, before insert or when selecting?

Met vriendelijke groet,

Paul Dam

Informatieanalist

Amyyon
Bijsterhuizen 11.58

6546 AS Nijmegen

050 - 311 5686

www.amyyon.nl <http://www.amyyon.nl/>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Claus Guttesen 2009-03-11 15:43:25 Re: Convert text from UTF8 to ASCII
Previous Message Scott Marlowe 2009-03-11 06:17:03 Re: Problem with an Empty Column