wsdl2java生成的代码导致字符编码问题 [英] wsdl2java generated code causes character encoding problems
问题描述
我从WSDL源生成了一堆Java文件.我使用Apache CXF 2.6.1生成文件.
I have generated a bunch of java-files from a WSDL source. I used Apache CXF 2.6.1 for generating the files.
当我将代码放到运行Jetty和Maven的生产盒中时,我通过生成的Java文件向服务器发送请求,它以某种方式更改了系统/JVM字符编码.瑞典语字符å,ä和ö变为Ã¥,ä,ö.
When I put the code onto our production box that is running jetty and maven and I send a request to the server via the generated java-files it somehow changes the systems/JVM character encoding. The swedish characters å, ä and ö changes into Ã¥, ä, ö.
我不能在自己的盒子上复制它.
I can't reproduce this on my own box.
有人有主意吗?
推荐答案
从2.5.4版开始,有一个新的命令行选项-encoding尚未在官方
Since version 2.5.4 there is a new command line option -encoding which is not yet documented on the official documentation. But when you call the tool with the help option (-h|-help) you will see the encoding option:
wsdl2java ... -encoding UTF-8 ....
这篇关于wsdl2java生成的代码导致字符编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!