Forum Discussion

Appconomy_Suppo's avatar
Appconomy_Suppo
Occasional Contributor
13 years ago

Support for Chinese characters

We are building a web services platform (Java) that will support Chinese users and therefor Chinese characters. One of the first things we are trying to test is if our web services can consistently handle the input of Chinese characters. The problem that I run into is that no matter how I copy and paste Chinese characters into the Request field, the characters are always replaced by question marks when you check the raw input.

Content of the request field:

{"user": {
"roleIds": ["4f10aa75820655d1538af713"],
"metadata": {},
"givenName": "面包",
"login": "面包",
"password": "面包",
"emailAddresses": ["cheiwing@yingpa.ch"],
"phoneNumbers": ["123 1234 1234"],
"familyName": "Chen",
"avatarUri": null,
}
}


Content of the Raw field

POST http://something@something.com:8080/matrix/rest/v1/users?xid=00000000QH7FM00000004 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: */*
Authorization: Basic YWRtaW46cGFzcw==
User-Agent: Jakarta Commons-HttpClient/3.1
Host: something@something.com:8080
Content-Length: 271

{"user": {
"roleIds": ["4f10aa75820655d1538af713"],
"metadata": {},
"givenName": "??",
"login": "??",
"password": "??",
"emailAddresses": ["cheiwing@yingpa.ch"],
"phoneNumbers": ["123 1234 1234"],
"familyName": "Chen",
"avatarUri": null,
}
}


I have tried copying and pasting the Chinese characters directly from Google Translate, Excel spreadsheet and Notepad++, but no success. There must be some way to allow SoapUI to support UTF-8, but I have not figured it out (yet). In my defense, we have only started using SoapUI a few days ago, so we are all very new to this tool.

Any help is much appreciated.
  • It turns out that the fix is to set Encoding to UTF-8 in the Request Properties for each request that uses Chinese characters. You can close this issue. Thx.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    don't let the contents of the Raw view fool you - soapUI is probably sending the correct characters but the font used in the Raw view is not able to display them. Have you tried switching to the native look and feel in the global UI Settings ?

    regards,

    /Ole
    SmartBear Software
  • Appconomy_Suppo's avatar
    Appconomy_Suppo
    Occasional Contributor
    I changed the look and feel to use 'Native LF' in the Preferences | UI Settings page, restarted SoapUI and invoked the method once more.

    The Json object in the Raw screen is exactly the same as before. All Chinese characters are replaced by question marks. The Json object that the method returns, also has questions marks for the fields that should Chinese characters.

    We have a number of unit tests where we instantiate objects with Chinese characters, without a problem.

    I seems that the issue might be with SoapUI. Can you please investigate this a bit further?


    Thx,

    Maarten
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Maarten,

    hmm... could you please attach the system properties shown in the Help\System Properties dialog?

    regards,

    /Ole
    SmartBear Software
  • Appconomy_Suppo's avatar
    Appconomy_Suppo
    Occasional Contributor
    Here it is ....

    GRE_HOME=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\.JxBrowser\xulrunner-windows-version-1.9.2.1\xulrunner-windows

    apple.laf.useScreenMenuBar=true

    awt.toolkit=sun.awt.windows.WToolkit

    com.apple.mrj.application.apple.menu.about.name=SoapUI

    exe4j.consoleCodepage=cp0
    exe4j.isInstall4j=true
    exe4j.launchName=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\soapUI-Pro-4.0.1.exe
    exe4j.moduleName=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\soapUI-Pro-4.0.1.exe
    exe4j.semaphoreName=c:_program files (x86)_smartbear_soapui-pro-4.0.1_bin_soapui-pro-4.0.1.exe0
    exe4j.tempDir=
    exe4j.unextractedPosition=0

    file.encoding=Cp1252
    file.encoding.pkg=sun.io
    file.separator=\

    install4j.appDir=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\
    install4j.exeDir=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\

    java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob=sun.awt.windows.WPrinterJob
    java.class.path=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\.install4j\i4jruntime.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\bin\soapui-pro-4.0.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\activation-1.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\activeQueryBuilder-trial.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\ActiveQueryBuilder.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\bcprov-jdk15-144.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\binding-2.0.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\cajo-1.142.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-beanutils-1.7.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-cli-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-codec-1.3.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-collections-3.2.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-digester-1.7.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-httpclient-3.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-io-1.3.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-lang-2.5.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\commons-logging-1.1.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\engine-gecko-2.8.28035.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\engine-ie-2.8.28035.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\engine-webkit-2.8.28035.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\ext-xmlbeans-1.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\ezmorph-1.0.5.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\flex-messaging-common-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\flex-messaging-core-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\flex-messaging-opt-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\flex-messaging-proxy-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\flex-messaging-remoting-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\forms-1.0.7.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\groovy-all-1.8.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\hermes-1.14.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\idw-1.6.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\itext-2.1.7.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\j2ee-xmlbeans-1.4.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jasperreports-4.0.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\javamail-1.4.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jcalendar-1.3.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jcommon-1.0.16.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jetty-6.1.26.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jetty-util-6.1.26.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jfreechart-1.0.13.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jms-1.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\js-1.7R2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\json-lib-2.2.2-jdk15.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jsr173_1.0_api-xmlbeans-2.4.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jtidy-r872-jdk15.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\junit-4.4.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jxbrowser-2.8.28035.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\jxl-2.6.12.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\l2fprod-common-directorychooser-7.3.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\l2fprod-common-fontchooser-7.3.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\license4j-1.3.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\log4j-1.2.14.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\looks-2.2.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\MozillaGlue-2.8.28035.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\MozillaInterfaces-2.8.28035.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\netcomponents-1.3.8a.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\not-yet-commons-ssl-0.3.11.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\opencsv-1.8.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\opensaml-1.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\policy-xmlbeans-1.5.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\reports-1.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\rsyntaxtextarea-1.3.4.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\saxon-9.1.0.8j.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\saxon-dom-9.1.0.8j.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\serializer-2.7.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\servlet-api-2.5-20081211.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\slf4j-api-1.5.8.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\slf4j-log4j12-1.5.8.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\soap-xmlbeans-1.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\soapui-4.0.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\soapui-coverage-xmlbeans-4.0.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\soapui-pro-4.0.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\soapui-xmlbeans-4.0.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\swingx-soapui.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\tuxpack-0.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\wadl-xmlbeans-1.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\winpack-3.8.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\wsdl4j-1.6.2-fixed.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\wss4j-1.5.8.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xalan-2.7.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xbean-fixed-2.4.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xbean_xpath-2.4.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xercesImpl-2.9.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xml-apis-2.9.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xmlpublic-2.4.0.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xmlsec-1.4.3.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xmlunit-1.2.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xom-1.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xstream-1.3.1.jar;C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin\..\lib\xulrunner-windows-2.8.28035.jar;
    java.class.version=50.0
    java.endorsed.dirs=c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\endorsed
    java.ext.dirs=c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
    java.home=c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre
    java.io.tmpdir=C:\Users\Maarten\AppData\Local\Temp\
    java.library.path=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1/bin
    java.rmi.server.hostname=0.0.0.0
    java.rmi.server.useCodebaseOnly=true
    java.runtime.name=Java(TM) SE Runtime Environment
    java.runtime.version=1.6.0_26-b03
    java.security.policy=server.policy
    java.specification.name=Java Platform API Specification
    java.specification.vendor=Sun Microsystems Inc.
    java.specification.version=1.6
    java.vendor=Sun Microsystems Inc.
    java.vendor.url=http://java.sun.com/
    java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
    java.version=1.6.0_26
    java.vm.info=mixed mode
    java.vm.name=Java HotSpot(TM) Client VM
    java.vm.specification.name=Java Virtual Machine Specification
    java.vm.specification.vendor=Sun Microsystems Inc.
    java.vm.specification.version=1.0
    java.vm.vendor=Sun Microsystems Inc.
    java.vm.version=20.1-b02

    jxbrowser.xulrunner.dir=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\.JxBrowser

    line.separator=


    os.arch=x86
    os.name=Windows 7
    os.version=6.1

    path.separator=;

    soapui.ext.actions=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1/bin/actions
    soapui.ext.libraries=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1/bin/ext
    soapui.ext.listeners=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1/bin/listeners
    soapui.home=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1/bin
    soapui.properties=soapui.properties

    sun.arch.data.model=32
    sun.boot.class.path=c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\resources.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\rt.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\sunrsasign.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\jsse.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\jce.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\charsets.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\lib\modules\jdk.boot.jar;c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\classes
    sun.boot.library.path=c:\program files (x86)\smartbear\soapui-pro-4.0.1\jre\bin
    sun.cpu.endian=little
    sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
    sun.desktop=windows
    sun.io.unicode.encoding=UnicodeLittle
    sun.jnu.encoding=Cp1252
    sun.management.compiler=HotSpot Client Compiler
    sun.os.patch.level=Service Pack 1

    user.country=US
    user.dir=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1\bin
    user.home=C:\Users\Maarten
    user.language=en
    user.name=Maarten
    user.timezone=America/Chicago
    user.variant=

    wsi.dir=C:\Program Files (x86)\SmartBear\soapUI-Pro-4.0.1/wsi-test-tools

    I hope this helps. Keep in mind that I am new to using this tool, so the likelyhood of me messing up / missing something is pretty high.
  • Appconomy_Suppo's avatar
    Appconomy_Suppo
    Occasional Contributor
    It turns out that the fix is to set Encoding to UTF-8 in the Request Properties for each request that uses Chinese characters. You can close this issue. Thx.