GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/652

    BROOKLYN-489: Fix XmlUtil.xpath character encoding

    Be explicit to use UTF_8. Otherwise, on some environments (e.g. windows?) 
it could use a different encoding.
    
    See https://issues.apache.org/jira/browse/BROOKLYN-489
    
    However, I'm struggling to test this. For @iyovcheva, the `XmlUtilTest` 
passed in her IDE. This included when we created another little test there to 
read the persisted state file that was failing (`qf4zems55y`, and call 
`XmlUtil.xpath`). Maybe there's something different about the character 
encodings when running brooklyn in karaf, versus in the IDE?!
    
    I also tried reproducing by changing `parent/pom.xml`, the 
`maven-surefire-plugin` configuration to include `-Dfile.encoding=ISO-8859-1`. 
I then ran `mvn test -Dtest=XmlUtilTest -Dfile.encoding=ISO-8859-1`. I 
confirmed that `Charset.defaultCharset()` writes out `ISO-8859-1`, but the 
tests still passed even without the change in this PR.
    
    ---
    Even though I can't reproduce, I think it's worth including the fix. 
Looking at the code, it's clearly wrong to not specify the character encoding.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server BROOKLYN-489

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/652.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #652
    
----
commit 371e7178e2501887e7d9820f3f05ff396bff00f3
Author: Aled Sage <[email protected]>
Date:   2017-04-25T19:22:16Z

    BROOKLYN-489: Fix XmlUtil.xpath character encoding
    
    Be explicit to use UTF_8. Otherwise, on some environments 
    (e.g. windows?) it could use a different encoding

----


---
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