Last modified: 2014-01-05 14:55:29 UTC
I made a simple test in http://en.wikipedia.org/wiki/User:Yamaha5/pdf as you see both are them are the same URL but the first is percentage URL and it should better that collection extension before rendering convert them to Unicode. Convertor Code in python (mediawiki has problem with {|} space which are in URLs so I replaced them with percentage one) import urllib def UnicodeURL(text): old_text=text RE=re.compile(ur'\/\/.*?(?=[\s\n\|\}\]]|$)') fa_Urls=RE.findall(text) if fa_Urls: for URL in fa_Urls: try: URL=URL.split('<')[0] new_URL=urllib.unquote(URL.encode('utf8')).decode('utf8').replace(u' ',u'%20').replace(u'{',u'%7B').replace(u'|',u'%7C').replace(u'}',u'%7D') text=text.replace(URL,new_URL) except: continue return text