Replace all characters that encodeURI does not replace, and move to FileUtils.