[PerlWikiBot] SF.net SVN: perlwikibot:[89] trunk/no-interwiki/upload_iw.pl
Status: Pre-Alpha
Brought to you by:
rotemliss
From: <am...@us...> - 2010-03-26 15:31:29
|
Revision: 89 http://perlwikibot.svn.sourceforge.net/perlwikibot/?rev=89&view=rev Author: amire80 Date: 2010-03-26 15:31:20 +0000 (Fri, 26 Mar 2010) Log Message: ----------- Thanks to almut and ikegami on PerlMonks. Modified Paths: -------------- trunk/no-interwiki/upload_iw.pl Modified: trunk/no-interwiki/upload_iw.pl =================================================================== --- trunk/no-interwiki/upload_iw.pl 2010-03-26 15:22:02 UTC (rev 88) +++ trunk/no-interwiki/upload_iw.pl 2010-03-26 15:31:20 UTC (rev 89) @@ -80,7 +80,12 @@ say Dumper(\@filenames); foreach my $filename (@filenames) { - my $pagename = Encode::decode('UTF-8', "$filename"); + # This was tested on Ubuntu. Other systems may have other encodings + # for file names. Test in a sandbox before using it on a live Wikipedia, + # otherwise pages with gibberish titles may be created. + # Thanks to almut and ikegami on PerlMonks: + # http://www.perlmonks.org/?node_id=830948 + my $pagename = Encode::decode('UTF-8', $filename); for ($pagename) { s/\.$INPUT_EXTENSION\z//xms; s/\A$dirname//xms; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |