[ 
http://jira.nuxeo.org/browse/NXP-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Jalon resolved NXP-4281.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 5.1.6
                   5.3.x
                   5.1.7

5.3 branch : http://hg.nuxeo.org/nuxeo/nuxeo-jsf/rev/995591e221cb
5.1.6 VCS branch : http://hg.nuxeo.org/nuxeo/nuxeo-platform/rev/ef4bdac3db6e
5.1.7 branch : http://hg.nuxeo.org/nuxeo/nuxeo-platform/rev/34a62123ba3d

> Response Encoding returned by CreationContainerListRestlet is ISO-8859-15 
> instead UTF-8
> ---------------------------------------------------------------------------------------
>
>                 Key: NXP-4281
>                 URL: http://jira.nuxeo.org/browse/NXP-4281
>             Project: Nuxeo Enterprise Platform
>          Issue Type: Bug
>    Affects Versions: 5.1.6
>         Environment: Restlet v1.0.7
>            Reporter: Benjamin Jalon
>            Assignee: Benjamin Jalon
>             Fix For: 5.1.7, 5.3.x, 5.1.6
>
>
> This code not set the response encoding :
> res.setEntity(resultDocument.asXML(), MediaType.TEXT_XML);
> by default this setEntity generate a StringRepresentation with charSet set to 
> Null.
> And for americans, it's logic to create StringRepresentation like that :
>     public StringRepresentation(CharSequence text, MediaType mediaType,
>             Language language) {
>         this(text, mediaType, language, CharacterSet.ISO_8859_1);
>     }
> In com.noelios.restlet.http.HttpServerConverter.addResponseHeaders implements 
> that :
>                 if (entity.getMediaType() != null) {
>                     StringBuilder contentType = new StringBuilder(entity
>                             .getMediaType().getName());
>                     if (entity.getCharacterSet() != null) {
>                         // Specify the character set parameter
>                         contentType.append("; charset=").append(
>                                 entity.getCharacterSet().getName());
>                     }
>                     responseHeaders.add(HttpConstants.HEADER_CONTENT_TYPE,
>                             contentType.toString());
>                 }
> So we need to create explicitly StringRepresentation and add characterSet in 
> the representation (che) :
>         Representation rep = new StringRepresentation(resultDocument.asXML(), 
> MediaType.TEXT_XML);
>         rep.setCharacterSet(CharacterSet.UTF_8);
>         res.setEntity(rep);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to