Re: utf8 issue

Поиск
Список
Период
Сортировка
От Tom Hart
Тема Re: utf8 issue
Дата
Msg-id 47C47EC5.2030602@coopfed.org
обсуждение исходный текст
Ответ на Re: utf8 issue  (Richard Huxton <dev@archonet.com>)
Ответы Re: utf8 issue
Список pgsql-general
Richard Huxton wrote:
> Tom Hart wrote:
>> Hello everybody. I recently converted my db from ASCII encoding to
>> UTF8 (we have a lot of spanish-speaking members, and need the extra
>> character support). Everything was working great, but I noticed this
>> error, while trying to COPY one of our tables from a csv.
>>
>> ERROR: invalid byte sequence for encoding "UTF8": 0xb9
>
> Not converted, I fear.
>
> Why not use latin9 rather than utf8 - that should cover everything and
> is probably what it's in anyway.
I was specifically requested to use UTF-8, and the work's already been
done, so converting again is not my favorite option.
>
>> Is there anything I can do to look for these sorts of errors and fix
>> them? I'm really not great with character encodings and I'm not sure
>> where to go on this. Any help?
>
> Google a bit for iconv (and postgresql) to get your characters valid.
>
I already have a php script that does some data scrubbing before the
copy. I added this line to the script and things seem to be working
better now

$line = iconv("ISO-8859-1", "UTF-8", $line);

Thanks for the help guys :-)

--
Tom Hart
IT Specialist
Cooperative Federal
723 Westcott St.
Syracuse, NY 13210
(315) 471-1116 ext. 202
(315) 476-0567 (fax)


В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: utf8 issue
Следующее
От: "fkater@googlemail.com"
Дата:
Сообщение: win32: how to backup (dump does not work)