Announcement Announcement Module
No announcement yet.
Possible character encoding/charset problem with Spring Rest Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Possible character encoding/charset problem with Spring Rest

    I can't find anyone else having an issue like this, so I'm not sure quite what's going on, but when retrieving some data using getForObject into a String, I seem to be having encoding problems.

    The line of code in question is:

    String str = rest.getForObject(restUrl, String.class, params);

    and the data being returned is UTF-8. I'm having problems with £ appearing in str (but if I fetch the data using a browser or some other application I do not have this problem).

    Spring web version is 3.0.5.RELEASE.

    If anyone has any insight into this issue or could give me any advice on what to look for, it would be greatly appreciated.

    Edit: possibly helpful information - when I was putting this into an object that was doing xml parsing on the data using xstream annotations, instead of a String, this problem was not occurring.
    Last edited by djm; Jul 14th, 2011, 06:15 AM.