Hi Alex, Thanks for spotting this bug. I have checked in SVN a fix.
Now, when we extract the "charset" parameter for a mediatype, we remove it from the list of parameters so it doesn't get written twice anymore. Best regards, Jerome -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Alex Milowski Envoyé : vendredi 1 août 2008 02:53 À : [email protected] Objet : Multiple Charsets with 1.1M5 Now that I've upgraded, any proxy code I have seems to be returning multiple "charset" parameters. That is, I have code that makes a call to another web service. I take the Representation instance received and return that as the Representation for the response call: Client client = ... Request appRequest = ... Response appResponse = client.handle(appRequest); if (appResponse.isEntityAvailable()) { getResponse().setEntity(appResponse.getEntity()); } Unfortunately, this results in two charset parameter values. That is, if the remote service returns "application/atom+xml; charset=UTF-8" the proxy service returns "application/atom+xml; charset=UTF-8; charset=UTF-8". Is that a bug or a feature? Seems like a bug to me. To fix this, I have to do: if (appResponse.isEntityAvailable()) { Representation rep = appResponse.getEntity(); MediaType type = rep.getMediaType(); String charset = type.getParmeters().getFirstValue("charset"); rep.setMediaType(MediaType.valueOf(rep.getMediaType().getName())); rep.setCharacterSet(CharacterSet.valueOf(charset)); } That seems rather onerous. --Alex Milowski

