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

Konrad Windszus commented on SLING-12776:
-----------------------------------------

Actually it seems the unescaping/escaping already happens for property reading 
(https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/334fa10956b101c24f62e22a54f33afc374085da/src/main/java/org/apache/sling/jcr/resource/internal/JcrValueMap.java#L298)
 and writing 
(https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/334fa10956b101c24f62e22a54f33afc374085da/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java#L66C33-L66C46)
 but not for resources themselves (mapped to nodes), neither for reading nor 
for writing.

Do you remember why it is that way [~cziegeler]?



> Automatically (un)escape illegal JCR characters in resource/property names
> --------------------------------------------------------------------------
>
>                 Key: SLING-12776
>                 URL: https://issues.apache.org/jira/browse/SLING-12776
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR
>    Affects Versions: JCR Resource 3.3.2
>            Reporter: Konrad Windszus
>            Priority: Major
>
> For JR2 and Oak the defacto standard for dealing with unsupported JCR 
> characters in node/property names is using 
> [o.a.j.util.Text.escapeIllegalJcrChars|https://jackrabbit.apache.org/api/2.14/org/apache/jackrabbit/util/Text.html#escapeIllegalJcrChars-java.lang.String-]
>  which resembles URI encoding. Compare also with 
> https://jackrabbit.apache.org/archive/wiki/JCR/EncodingAndEscaping_115513396.html.
> However the JCR Resource provider currently just simply fails for invalid 
> names (when writing) and does not unescape those names when reading.
> As the Sling API does not define any limitations on resource names (except 
> for "/" which is used as path separator) I would expect that invalid 
> characters are transparently handled by the underlying provider.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to