1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-04 08:25:03 -05:00

* fixed possible NPE

This commit is contained in:
Reinhard Pointner 2009-10-22 12:19:22 +00:00
parent 916f168d98
commit 6f95136431

View File

@ -143,10 +143,15 @@ public final class WebRequest {
Logger.getLogger(WebRequest.class.getName()).log(Level.WARNING, e.getMessage());
}
}
// use http default encoding only for text/html
if (contentType.equals("text/html")) {
return Charset.forName("ISO-8859-1");
}
}
// use http default encoding only for text/html, use UTF-8 for everything else (e.g. XML)
return Charset.forName(contentType.equals("text/html") ? "ISO-8859-1" : "UTF-8");
// use UTF-8 if we don't know any better
return Charset.forName("UTF-8");
}