Output Encoding issue in mule esb

杀马特。学长 韩版系。学妹 提交于 2019-12-24 16:13:52

问题


I have used to do create XML using "Transform Message" Node in Mule ESB.

%dw 1.0 %output application/xml

item: { name: payload."profile_name", id: payload."profile_Id" }

This shown a preview of output xml as

<?xml version='1.0' encoding='windows-1252'?>
<item>
  <name>
    <profile_name>????</profile_name>
  </name>
  <id>
    <profile_Id>1</profile_Id>
  </id>
</item>

This resulted encoding as 'windows-1252' how can i change encoding as 'UTF-8' in my outpout xml ?


回答1:


Go to your Anypoint Studio folder.

Edit AnypointStudio.ini

Add: -Dfile.encoding=UTF-8

Restart




回答2:


Easy, define encoding in the output line:

%dw 1.0
%output application/xml encoding="utf-8"
---
name: payload.name?

the result:

<?xml version='1.0' encoding='utf-8'?>
<name>false</name>


来源:https://stackoverflow.com/questions/34261145/output-encoding-issue-in-mule-esb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!