Re: Find out encoding of data

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Find out encoding of data
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C24FA270@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: Find out encoding of data  (joynes <joynes@hotmail.com>)
Ответы Re: Find out encoding of data  (joynes <joynes@hotmail.com>)
Список pgsql-general
joynes wrote:
> This doesnt work for me but it is exactly what I want. When I run your
> example I just get:
>
> >SELECT decode('10EUR', 'escape');
>  decode
> --------
>  10EUR
> (1 rad)
>
> I get the same result, both if the database is UTF8 or
> ISO-Latin1 and also
> with different versions of postgres (7 and 8)
>
> And when I read the documentation for 'decode' it tells that
> it just decodes
> binary strings encoded with 'encode'.
> How did you get that result from running decode?

I suspect that somewhere along the line the Euro symbol I
used in the query got changed to 'EUR'.

Try some other string with weird characters.

It will show all non-ASCII characters in escaped octal
notation, while ASCII characters will remain as they are.

This should help you - if I understood you correctly,
you want to know the actual bytes stored in a database
field. To find our the numeric representation of an ASCII
field, you can use the function ascii().

Yours,
Laurenz Albe

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

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: datestyle question
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Can't access Cluster