From fcaa5463564a11afb6435cd81b4100ad086dbf30 Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Mon, 29 Jun 2009 13:07:53 +0000 Subject: [PATCH] Issue 70, hard set encoding to UTF-8 to avoid silent errors that result in characters being converted to '???' git-svn-id: http://jclouds.googlecode.com/svn/trunk@1490 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../org/jclouds/http/commands/callables/xml/ParseSax.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/jclouds/http/commands/callables/xml/ParseSax.java b/core/src/main/java/org/jclouds/http/commands/callables/xml/ParseSax.java index 8e70f69b9f..281d4be06e 100644 --- a/core/src/main/java/org/jclouds/http/commands/callables/xml/ParseSax.java +++ b/core/src/main/java/org/jclouds/http/commands/callables/xml/ParseSax.java @@ -92,7 +92,9 @@ public class ParseSax extends HttpFutureCommand.ResponseCallable { IOUtils.closeQuietly(xml); xml = IOUtils.toInputStream(response); } - parser.parse(new InputSource(xml)); + InputSource input = new InputSource(xml); + input.setEncoding("UTF-8"); + parser.parse(input); } catch (Exception e) { StringBuilder message = new StringBuilder(); message.append("Error parsing input for ").append(handler);