Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/652#discussion_r113293256
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/xstream/XmlUtil.java ---
    @@ -65,7 +66,7 @@ public static String xpath(String xml, String xpath) {
         public static Object xpath(String xml, String xpath, QName returnType) 
{
             try {
                 DocumentBuilder builder = SharedDocumentBuilder.get();
    -            Document doc = builder.parse(new 
ByteArrayInputStream(xml.getBytes()));
    +            Document doc = builder.parse(new 
ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
    --- End diff --
    
    Better use `new InputSource( new StringReader( xml ) );`. Otherwise it's 
not clear how `builder.parse(InputStream)` will decode the input. Probably will 
use the standard system encoding again (since we don't have prologues on the 
files).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to