Re: Percent-encoding conversion to binary, %C2%A9 = © - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Percent-encoding conversion to binary, %C2%A9 = ©
Date
Msg-id 20080315135622.GC16516@svana.org
Whole thread Raw
In response to Percent-encoding conversion to binary, %C2%A9 = ©  (Hans Schou <hans.schou@gmail.com>)
List pgsql-general
On Thu, Mar 13, 2008 at 03:49:37PM +0100, Hans Schou wrote:
> Hi
>
> I have a little trouble with the chr() function.
>
> I have a string like this:
> "Copyright+%C2%A9+1856+Na%C3%AFve+retros%C2%AE"
> which should be converted to binary string like:
> "Copyright © 1856 Naïve retros®"
>
> Is there an easy way to do this conversion?

Looks like you have UTF-8 encoded with percent signs. Perhaps the right
approach is you covert the incoming text into a bytea array and then
use convert() to turn it in to a string.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Permission template
Next
From: Ron Mayer
Date:
Subject: Re: postgre vs MySQL