mirror of https://github.com/apache/jclouds.git
Issue 70: InputStreamReader is a more effective way to enforce encoding
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1494 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
563be0cb55
commit
9072a949d3
|
@ -26,6 +26,7 @@ package org.jclouds.http.commands.callables.xml;
|
|||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jclouds.http.HttpException;
|
||||
|
@ -92,8 +93,7 @@ public class ParseSax<T> extends HttpFutureCommand.ResponseCallable<T> {
|
|||
IOUtils.closeQuietly(xml);
|
||||
xml = IOUtils.toInputStream(response);
|
||||
}
|
||||
InputSource input = new InputSource(xml);
|
||||
input.setEncoding("UTF-8");
|
||||
InputSource input = new InputSource(new InputStreamReader(xml,"UTF-8"));
|
||||
parser.parse(input);
|
||||
} catch (Exception e) {
|
||||
StringBuilder message = new StringBuilder();
|
||||
|
|
Loading…
Reference in New Issue