http://www.perlmonks.org?node_id=1021076


in reply to Re^2: Remove unicode "whitespace"
in thread Remove unicode "whitespace"

Give URI::Encode a try.
#!usr/bin/perl -l use strict; use warnings; use URI::Encode qw(uri_decode); my $encoded = 'http://commons.wikimedia.org /wiki/File:Atelerix_algirus.jpg%E2%80%8E'; print uri_decode($encoded);

Replies are listed 'Best First'.
Re^4: Remove unicode "whitespace"
by HYanWong (Acolyte) on Mar 01, 2013 at 01:44 UTC

    Yes, I've done that. It converts the %E2%80%8E string to the unicode LRM character, which isn't printed, but is still embedded in the string, causing problems when accessing the URL again. Thanks, though.