开发者

MediaWiki Special Characters in file name issue

When I upload a file onto mediawiki with Special Characters in the name it mangles the filename into something that looks like this:

Waterford_(Dáil_Éireann_constituency).png

when it actually writes it to the file when it should actually look like this:

Waterford_(Dáil_Éireann_constituency).png

Which me开发者_开发技巧ans that when another page links to that file it comes up as a broken image link because it's looking for

http://mysite.com/wiki/images/Waterford_(Dáil_Éireann_constituency).png

I don't want to prevent people from using special characters as often they copy the files from wikipedia which supports special characters, and I think it's something to do with the way my host handles files. So it would be preferable if there was some way to intercept the way that mediawiki creates the files so that the filepath would be free from special characters while all the references would still work.


MediaWiki is 100% UTF-8 safe, but something somewhere in your Apache/PHP configuration is mangling UTF-8 into ISO 8859-1 (Latin1). Start by making sure your PHP install has mbstring enabled as specified here:

http://www.mediawiki.org/wiki/PHP_configuration

If you're stuck with a messed-up host, then this Talk page has some clues for stabbing your Wiki with a knife to make it dumb down filenames:

http://www.mediawiki.org/wiki/Manual_talk:Configuring_file_uploads#Image_File_Names


I can't speak on how and where to do this in Mediawiki, but a good way to do this would be to urlencode() the file name. Percent encoded file names should work on all platforms, and it's easy to restore them into proper form when necessary.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜