This queue is for tickets about the PHP-HTTPBuildQuery CPAN distribution.

Report information
The Basics
Id:
74784
Status:
resolved
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
gms8994 [...] dp.cx
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
0.03
Fixed in:
0.03



Subject: Uses uri_escape; should use uri_escape_utf8
Can't escape \x{2013}, try uri_escape_utf8() instead at /usr/lib64/perl5/site_perl/5.12.3/PHP/HTTPBuildQuery.pm line 103
To perform a fairly standard task like escaping utf8 text, are you sure this is the correct approach? Instead of changing a variety of CPAN modules and make them use a different decoding function (uri_escape_utf8), wouldn't it be more appropriate to fix uri_escape to make it support utf8?
From: gms8994@dp.cx
On Fri Feb 17 20:25:29 2012, MSCHILLI wrote:
Show quoted text
> To perform a fairly standard task like escaping utf8 text, are you
sure
Show quoted text
> this is the correct approach? > > Instead of changing a variety of CPAN modules and make them use a > different decoding function (uri_escape_utf8), wouldn't it be more > appropriate to fix uri_escape to make it support utf8?
I was unsure how best to respond to this question, so I went to irc.freenode.org #perl. Per mauke, a #perl regular: 09:50 < mauke> dp_: the answer is "no" 09:51 < mauke> dp_: to perform a fairly standard task like escaping utf8 text, using uri_escape_utf8 is the correct approach because that's not what uri_escape does. 09:51 < mauke> dp_: if there are a variety of CPAN modules that use uri_escape with unicode text, those modules are broken 09:51 < mauke> dp_: also, it's not a decoding function 09:52 < mauke> dp_: uri_escape can't be fixed because it's not broken
Since users might want the old behavior as well, I've added a new function http_build_query_utf8() for this: https://github.com/mschilli/php-httpbuildquery- perl/commit/649f529e1d654e52c6bfd6ae07f3b26e6eb10208 Let me know if it works for you. -- Mike


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.