Re: [GENERAL] How to convert HEX to ASCII?

2011-12-23 Thread Pavel Stehule
Hello all just note 9.1 will have a bytea_agg aggregate regards Pavel Stehule 2011/12/2 Marti Raudsepp : > On Fri, Dec 2, 2011 at 16:16, Torsten Zuehlsdorff > wrote: >> But i clearly have a missunderstanding of other chars, like umlauts or utf-8 >> chars. This, for example, should return a 'ö

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-03 Thread Torsten Zühlsdorff
Marti Raudsepp schrieb: On Fri, Dec 2, 2011 at 16:16, Torsten Zuehlsdorff wrote: But i clearly have a missunderstanding of other chars, like umlauts or utf-8 chars. This, for example, should return a 'ö': # SELECT chr(x'C3B6'::int); chr - 쎶 (1 row) That gives you the Unicode codepoint

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Pavel Stehule
2011/12/2 Merlin Moncure : > On Fri, Dec 2, 2011 at 2:01 PM, Pavel Stehule wrote: so bytea_agg - one param aggregate has sense it's very easy to implement it >>> >>> yup: >>> >>> create aggregate bytea_agg (bytea) >>> ( >>>  sfunc=byteacat, >>>  stype=bytea >>> ); >> >> this is work

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 2:01 PM, Pavel Stehule wrote: >>> so bytea_agg - one param aggregate has sense >>> >>> it's very easy to implement it >> >> yup: >> >> create aggregate bytea_agg (bytea) >> ( >>  sfunc=byteacat, >>  stype=bytea >> ); > > this is workaround :) > > without a memory preallocati

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Pavel Stehule
2011/12/2 Merlin Moncure : > On Fri, Dec 2, 2011 at 11:15 AM, Pavel Stehule > wrote: >> 2011/12/2 Merlin Moncure : >>> On Fri, Dec 2, 2011 at 10:42 AM, Marti Raudsepp wrote: Sorry, but AFAICT this makes a mess of encodings and only works by pure luck. The server thinks it's sending the

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 11:15 AM, Pavel Stehule wrote: > 2011/12/2 Merlin Moncure : >> On Fri, Dec 2, 2011 at 10:42 AM, Marti Raudsepp wrote: >>> Sorry, but AFAICT this makes a mess of encodings and only works by >>> pure luck. The server thinks it's sending the client LATIN1 text, but >>> it's ac

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Pavel Stehule
2011/12/2 Merlin Moncure : > On Fri, Dec 2, 2011 at 10:42 AM, Marti Raudsepp wrote: >> Sorry, but AFAICT this makes a mess of encodings and only works by >> pure luck. The server thinks it's sending the client LATIN1 text, but >> it's actually UTF8-encoded and the last decoding step is done by you

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 10:42 AM, Marti Raudsepp wrote: > Sorry, but AFAICT this makes a mess of encodings and only works by > pure luck. The server thinks it's sending the client LATIN1 text, but > it's actually UTF8-encoded and the last decoding step is done by your > terminal. yup -- your're ri

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Marti Raudsepp
On Fri, Dec 2, 2011 at 16:16, Torsten Zuehlsdorff wrote: > But i clearly have a missunderstanding of other chars, like umlauts or utf-8 > chars. This, for example, should return a 'ö': > > # SELECT chr(x'C3B6'::int); > chr > - > 쎶 > (1 row) That gives you the Unicode codepoint C3B6, but %C3

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 8:16 AM, Torsten Zuehlsdorff wrote: > Damien Churchill schrieb: > > >>> after several attempts I have finally succeeded in developing a >>> urlencode() >>> function to encode text correctly like defined in RFC 1738. >>> >>> Now i have a big problem: how to decode the text? >

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Torsten Zuehlsdorff
Damien Churchill schrieb: after several attempts I have finally succeeded in developing a urlencode() function to encode text correctly like defined in RFC 1738. Now i have a big problem: how to decode the text? Example: # SELECT urlencode('Hellö World!'); urlencode -

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Damien Churchill
On 2 December 2011 13:18, Torsten Zuehlsdorff wrote: > Hello, > > after several attempts I have finally succeeded in developing a urlencode() > function to encode text correctly like defined in RFC 1738. > > Now i have a big problem: how to decode the text? > > Example: > # SELECT urlencode('Hellö

[GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Torsten Zuehlsdorff
Hello, after several attempts I have finally succeeded in developing a urlencode() function to encode text correctly like defined in RFC 1738. Now i have a big problem: how to decode the text? Example: # SELECT urlencode('Hellö World!'); urlencode --- Hell%C3%B6%20