Search Postgresql Archives

Re: Find out encoding of data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux