Thread: BUG #4336: Strange behaviour for to_ascii

BUG #4336: Strange behaviour for to_ascii

From
"Maxime Carbonneau"
Date:
The following bug has been logged online:

Bug reference:      4336
Logged by:          Maxime Carbonneau
Email address:      manitou@maikan.com
PostgreSQL version: 8.3.3
Operating system:   Mac OS X 10.5.4
Description:        Strange behaviour for to_ascii
Details:

With PostgreSQL 8.2.5, I used to_ascii to remove accents:
SELECT TO_ASCII(CONVERT('école' USING utf8_to_iso_8859_15), 'latin9');
=> ecole
With PostgreSQL 8.3.3, I had to made some changes since convert using is
gone. I'm using: SELECT
to_ascii(encode(convert_to('école','LATIN9'),'escape'),'LATIN9');
but the result is
=> \351cole

How can I remove accent letter with PostgreSQL 8.3.3?

Re: BUG #4336: Strange behaviour for to_ascii

From
"Pavel Stehule"
Date:
SGVsbG8KCml0J3MgYnVnLAoKZm9yIHRoaXMgbW9tZW50LCBwbGVhc2UsIHRy
eToKCgpDUkVBVEUgRlVOQ1RJT04gdG9fYXNjaWkoYnl0ZWEsIG5hbWUpClJF
VFVSTlMgdGV4dCBBUyAndG9fYXNjaWlfZW5jbmFtZScgTEFOR1VBR0UgaW50
ZXJuYWw7Cgpwb3N0Z3Jlcz0jIENSRUFURSBGVU5DVElPTiB0b19hc2NpaShi
eXRlYSwgbmFtZSkKcG9zdGdyZXMtIyBSRVRVUk5TIHRleHQgQVMgJ3RvX2Fz
Y2lpX2VuY25hbWUnIExBTkdVQUdFIGludGVybmFsOwpDUkVBVEUgRlVOQ1RJ
T04KcG9zdGdyZXM9Iwpwb3N0Z3Jlcz0jIFNFTEVDVCB0b19hc2NpaShjb252
ZXJ0X3RvKCdQxZnDrWxpxaEgxb5sdXTDvSBrxa/FiCcsICdsYXRpbjInKSwn
bGF0aW4yJyk7CiAgICAgdG9fYXNjaWkKLS0tLS0tLS0tLS0tLS0tLS0tCiBQ
cmlsaXMgemx1dHkga3VuCigxIHJvdykKCgpwb3N0Z3Jlcz0jIFNFTEVDVAp0
b19hc2NpaShjb252ZXJ0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