Skip to content

Commit

Permalink
fix download file name decode
Browse files Browse the repository at this point in the history
  • Loading branch information
hazuki0x0 committed Nov 18, 2017
1 parent 15c8c60 commit cff962e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/jp/hazuki/yuzubrowser/utils/HttpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public static File getFileName(String url, String defaultExt, Map<String, List<S
if (normal.find()) {
try {
return FileUtils.createUniqueFile(AppData.download_folder.get(), URLDecoder.decode(normal.group(1), "UTF-8"));
} catch (IllegalArgumentException e) {
return FileUtils.createUniqueFile(AppData.download_folder.get(), FileUtils.replaceProhibitionWord(normal.group(1)));
} catch (UnsupportedEncodingException e) {
throw new AssertionError("UTF-8 is unknown");
}
Expand Down

0 comments on commit cff962e

Please sign in to comment.