Invalid input syntax when inserting urls with accents
natoinet opened this issue · comments
@ntoinet commented
Hello,
When inserting urls with accents, I run into the following error:
insert into urljson values ('http://www.example.com/évidemment', 200, 'text/html; charset=UTF-8', 33055);
ERROR: invalid input syntax for type uri at or near "évidemment"
LINE 1: insert into urljson values ('http://www.example.com/évidemme...
^
I know that urls should not contain accents ... But they actually do! Is it caused by some kind of encoding problems?
Thanks!
Peter Eisentraut commented
Punycode is not supported. Maybe it should.
Antony commented
In the mean time there is an other extension that can solve your problem.
https://github.com/okbob/url_encode
insert into urljson values
(
url_encode('http://www.example.com/évidemment'),
200,
'text/html; charset=UTF-8', 33055
);