Skip to content

Commit

Permalink
Merge pull request #205 from icgeass/master
Browse files Browse the repository at this point in the history
utf-8 fix
  • Loading branch information
mpetazzoni authored Jul 1, 2017
2 parents 0acd62d + a38d3e2 commit 98485dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/com/turn/ttorrent/common/Torrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ public Torrent(byte[] torrent, boolean seeder) throws IOException, NoSuchAlgorit
for (BEValue file : this.decoded_info.get("files").getList()) {
Map<String, BEValue> fileInfo = file.getMap();
StringBuilder path = new StringBuilder();
for (BEValue pathElement : fileInfo.get("path").getList()) {
BEValue beValue = fileInfo.get("path.utf-8");
if(null == beValue){
beValue = fileInfo.get("path");
}
for (BEValue pathElement : beValue.getList()) {
path.append(File.separator)
.append(pathElement.getString());
}
Expand Down

0 comments on commit 98485dc

Please sign in to comment.