You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Florian Müller (Commented JIRA)" <ji...@apache.org> on 2011/12/06 19:55:41 UTC

[jira] [Commented] (CMIS-483) URLEncoder for getObjectByPath with folder name like CARÈ CARLA

    [ https://issues.apache.org/jira/browse/CMIS-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13163738#comment-13163738 ] 

Florian Müller commented on CMIS-483:
-------------------------------------

UTF-8 is strongly recommended [1][2] for interoperability. Why should the encoding be configurable?

[1] http://tools.ietf.org/html/rfc3986#section-2.5
[2] http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars
                
> URLEncoder for getObjectByPath with folder name like CARÈ CARLA
> ---------------------------------------------------------------
>
>                 Key: CMIS-483
>                 URL: https://issues.apache.org/jira/browse/CMIS-483
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client-bindings
>    Affects Versions: OpenCMIS 0.5.0
>            Reporter: Marco Spasiano
>              Labels: patch
>
> What do you think about this patch?
> {noformat}
> ### Eclipse Workspace Patch 1.0
> #P chemistry-opencmis-client-bindings
> Index: src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java
> ===================================================================
> --- src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java	(revisione 1124118)
> +++ src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkCache.java	(copia locale)
> @@ -68,6 +68,7 @@
>      private final Cache templateCache;
>      private final Cache repositoryLinkCache;
>  
> +    private final String encoding;
>      /**
>       * Constructor.
>       */
> @@ -87,6 +88,8 @@
>              objCount = CACHE_SIZE_OBJECTS;
>          }
>  
> +        encoding = (String) session.get(SessionParameter.LOCALE_VARIANT, "UTF-8");
> +        
>          linkCache = new CacheImpl("Link Cache");
>          linkCache.initialize(new String[] {
>                  MapCacheLevelImpl.class.getName() + " " + MapCacheLevelImpl.CAPACITY + "=" + repCount, // repository
> @@ -257,7 +260,7 @@
>                      String paramValue = UrlBuilder.normalizeParameter(parameters.get(param.toString()));
>                      if (paramValue != null) {
>                          try {
> -                            result.append(URLEncoder.encode(paramValue, "UTF-8"));
> +                            result.append(URLEncoder.encode(paramValue, encoding));
>                          } catch (UnsupportedEncodingException e) {
>                              result.append(paramValue);
>                          }
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira