UTF-8 characters with JAXB in Java 8
<p>I recently migrated an application for JBoss AS 5 to Wildfly 8, and as such had to move from Java 6 to Java 8. </p>

<p>I'm now encountering a problem when running one of my unit tests through Ant:</p>

<pre><code>[javac] C:\Users\test\JAXBClassTest.java:123: error: unmappable character for encoding UTF8
</code></pre>

<p>Line 123 of the test class is:</p>

<pre><code>Assert.assertEquals("Jµhn", JAXBClass.getValue()); 
</code></pre>

<p>This test is in place specifically to ensure that the JAXB marshaller can handle UTF-8 characters, which I believe <code>µ</code> is. I have added a property onto the JAXB marshaller to ensure that these characters are allowed:</p>

<pre><code>marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
</code></pre>

<p>I've seen multiple questions (<a href="https://stackoverflow.com/questions/30575509/java-8-change-in-utf-8-decoding">1</a>, <a href="https://stackoverflow.com/questions/25404373/java-8-utf-8-encoding-issue-java-bug">2</a>, <a href="https://stackoverflow.com/questions/18382933/java-jaxb-utf-8-iso-convertions">3</a>) on Stack Overflow which seem to be similar but their answers wither explain why invalid characters which were previously decoded one way are now decoded in another or don't appear to actually have the same issue as me. </p>

<p>If all the characters are valid should this cause an issue? I know I must be missing something but I can't see what. </p>