Java Component in Mule does not use project's UTF-8 encoding
<p>I have a java component in Mule that is returning a String.  When I print that string from within the java component, it reads as UTF-8 just fine in the console.  However, when I return this as the payload, the subsequent logger and all downstream components can no longer read the UTF-8 characters.  I've confirmed that my project's encoding setting is set to 'UTF-8'.  I've also:</p>

<ol>
<li>Setting <code>MULE_ENCODING=UTF-8</code> before and after the Java component, both as an outbound property and invocation property.  </li>
<li>Setting the encoding on the message in a mule expression, but that failed <code>message.setEncoding('UTF-8')</code> with an error stating it could not find the method <code>setEncoding()</code>  </li>
<li><p>Using the following in the java component: </p>

<pre><code>eventContext.getMessage().setPayload(myString);
eventContext.getMessage().setEncoding("UTF-8");
return  eventContext.getMessage().getPayload(); 
</code></pre></li>
<li><p>Switching to a java transformer instead of a component, using the below config on the transformer, explicitly setting encoding to "UTF-8".</p>

<pre><code>&lt;custom-transformer encoding="UTF-8"
  class="myDomain.myJavaTransformer" doc:name="Java"/&gt;
</code></pre></li>
</ol>

<p>I'm not sure what else to try to ensure the payload coming out of the java component/transformer is not interpreted or converted to another encoding...</p>

<p>The output should read:  “Outstanding New Environmental Scientist”</p>

<p>The logger currently outputs is â€œOutstanding New Environmental Scientistâ€. I've corrected this in other parts of the flow by adding encoding=UTF-8 to any VM endpoints, for example. I've also confirmed that this can print correctly in a logger elsewhere in the flow.</p>

<p>There seems to be something happening after the String is returned from within the java class referenced by the java component and the subsequent mule logger...</p>