Search code examples
javaxmlrestencodingalm

Different response encoding REST using JAVA between my localhost and My Server


I'm trying to get a xml from a REST connection. In my local machine i receive it with the right encoding. e.g.: 수정완료 but in my server I receive the same request as 수정완료.

Using the web browser in both machines I receive the REST request correctly.

Any ideas?

I'm using Apache Tomcat 6.0 in both machines

EDITED: I'm follow this example:

http://support.openview.hp.com/selfsolve/document/KM997956/binary/ALM11.00_REST_API.html?searchIdentifier=-765a98c0%3a12de84ca170%3a-27ac&resultType=document

user: exampleStack
pass: example

Direct source link: http://h30499.www3.hp.com/hpeb/attachments/hpeb/itrc-895/68767/1/alm_rest.zip

Thanks in advance.


Solution

  • I finally got the answer to solve this issue thanks to this post: https://forums.adobe.com/message/3602618

    What I needed to do was instead get directly the string from the Rest response, get its bite[] and then encode it correctly: =)

    String myXmlEncoded = new String(con.httpGet().getResponseData(), "UTF-8");
    

    Thanks guys.