Hi Hannes,
you could explicit set the character encoding of a representation.
Perhaps you have to set ISO-8859-1 into the representation? Use
Representation.setCharacterSet(...)
best regards
Stephan
Hannes Ebner schrieb:
Hello
I have an object which I send with a PUT to the server using
ObjectRepresentation. The object is serializable and holds Strings,
Dates, etc - everything works fine, except for Umlauts and other
non-ASCII characters when the client and the server have different
default character encodings.
E.g., when I send the object from a UTF-8 client to a UTF-8 server,
everything works. The same object sent to an ISO-8859-1 server results
in messed up non-ASCII characters on the server side (I just tried with
Umlauts, but I assume it would be the same with others as well).
I'm using the following code:
Request request = new Request(Method.PUT, resourceURI);
Representation rep = new ObjectRepresentation<DataSet>(dataSet);
rep.setMediaType(MediaType.APPLICATION_JAVA_OBJECT);
request.setEntity(rep);
Client client = new Client(Protocol.HTTP);
Response response = client.handle(request);
And the other way round on server side. I assumed that I do not have to
take care of the encoding/decoding of Strings when I send data between
systems (especially when I don't know which encoding is used on the
client systems).
Do I miss anything important?
Thanks,
Hannes