Sanitize names of uploaded files in WordPress

Nothing worse than user contributed image files with strange (non-english) characters in the file name right? Here's what you can do about it in WordPress.

If you are working with WordPress Sites in non-english languages, like for instance Swedish, like I am, sometimes there can be a world if pain when moving sites between hosts if the file names include non-standard charachters such as åÅ, äÄ, öÖ. The images appear as broken, becuase something with the file name encoding happens along the way.