Re: Character encoding in database dumps

From: Lynna Landstreet <lynna(at)gallery44(dot)org>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Character encoding in database dumps
Date: 2004-06-11 19:06:08
Message-ID: BCEF7AE0.13AB%lynna@gallery44.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

on 6/10/04 8:19 AM, Aarni Ruuhimäki at aarni(at)kymi(dot)com wrote:

> Have you tried restoring your data from the dumps ?

No - I wanted to, but my web host's control panel appears to be down so I
can't create a new database to restore it into, and I don't want to risk
restoring it into the existing database in case it screws everything up. And
the dump file was still messed up when I tried viewing it in my browser, as
you suggest.

However, I found the answer. I should have actually figured it out sooner,
because I originally had the same problem in reverse when trying to get data
*into* the database: FTP programs tend to send text files in ASCII format,
which doesn't support Unicode. When I uploaded the text files to \copy my
data into the database from, I had to make sure the FTP program used binary
mode, and in order to make it do that, I had to change the file extension to
something my internet preferences did not brand as ASCII automatically.

Turned out to be what was happening here as well. I had to skip using
phpPgAdmin's Export function and just use pg_dump via a shell connection,
and name the dump something that did not end in .txt or .sql or anything
like that, and then download it as binary, and *then* open it in BBEdit with
the "Read as" option set to UTF-8. Once I did that, all my special
characters were OK.

Major headache, though. I'm hoping as things evolve, Unicode support will be
built into more programs including those where it's currently not thought
necessary like FTP programs. People need to learn that ASCII is *not*
necessarily the correct format for all text files...

Lynna

--
Resource Centre Database Coordinator
Gallery 44
www.gallery44.org

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2004-06-11 19:33:11 Re: Character encoding in database dumps
Previous Message Markus Bertheau 2004-06-11 07:11:46 Re: Upgrade OOPS