Re: Percent-encoding conversion to binary, %C2%A9 = ©

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Percent-encoding conversion to binary, %C2%A9 = ©
Дата
Msg-id 20080315135622.GC16516@svana.org
обсуждение исходный текст
Ответ на Percent-encoding conversion to binary, %C2%A9 = ©  (Hans Schou <hans.schou@gmail.com>)
Список 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.

Вложения

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Permission template
Следующее
От: Ron Mayer
Дата:
Сообщение: Re: postgre vs MySQL