Slanty apostrophy problem ‘solved’

M Clark mclark at gmx.co.uk
Tue Feb 10 11:52:14 PST 2015


I'm using WebPVR on Windows and fall foul when queuing a programme that contains a slanty apostrophy somewhere in its entry.
This abends the web interface and I have to restart Web PVR Manager.
Message is; Can't escape \x{2019}, try uri_escape_utf8() instead at get_iplayer.cgi line 475.
Thank you Perl.
Changed line 475 from uri_escape to uri_escape_utf8.
Re-ran.
Abend.
Message; Undefined subroutine &main::uri_escape_utf8 called at get_iplayer.cgi line 475, <GEN2> line 13.
Thank you Perl.
Changed 'use URI::Escape qw(uri_escape);' to 'use URI::Escape qw(uri_escape_utf8);'
Re-ran.
Partial success.
Queued: radio: 'Witness - Finlandâs Winter War' (p02jcq3q)
No Perl, that's not what I want.

So backed out changes added the following above line 475 [ $val = uri_escape($val); ].

$val =~ tr/\x{2019}\x{2018}/''/;

Which gives what I want.
Queued: radio: 'Witness - Finland's Winter War' (p02jcq3q).

Puts on Tin Hat and awaits flak for committing programming sin of hard-coded magic-numbers.

Also I've had similar problem with, I think, x{2103} or x{2013}, certainly something else, so I'll have to add to this translate sometime in the future.

So I know a little bit more about Perl but there must be a better solution given that neither uri_escape nor uri_escape_utf8 can handle this problem 'correctly'.


Regards.



More information about the get_iplayer mailing list