You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Santiago Gala (JIRA)" <ji...@apache.org> on 2012/10/04 16:07:47 UTC

[jira] [Created] (SLING-2613) Sling double encodes posted data

Santiago Gala created SLING-2613:
------------------------------------

             Summary: Sling double encodes posted data
                 Key: SLING-2613
                 URL: https://issues.apache.org/jira/browse/SLING-2613
             Project: Sling
          Issue Type: Bug
         Environment: Ubuntu linux 12.04.1
            Reporter: Santiago Gala


# start in a clean place
cd /tmp

rm -Rf slinng

# download sling standalone (pick your own mirror if needed)
wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar

# run it in the background
java -jar org.apache.sling.launchpad-6-standalone.jar  &
pid=$!

# wait a couple of minutes for it to settle down
sleep 120 

curl http://localhost:8080/apps.tidy.json
#{
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}

# add a property
curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
#... blah blah ...

# recover it again...
curl http://localhost:8080/apps.tidy.json
#{
#  "español": "sánchez",
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"



# OOPS, it is doubly encoded...
# my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install

kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2613) Sling double encodes posted data

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469410#comment-13469410 ] 

Julian Reschke commented on SLING-2613:
---------------------------------------

If I understand correctly, what you see is the effect of the server doing the decoding with ISO-8859-1. If that is the case, adding a parameter called "_charset_" and setting it to UTF-8 should address the issue. (in the curl POST request) 
                
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling explorer double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Attachment:     (was: sling-bug.sh)
    
> Sling explorer double encodes posted data
> -----------------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>
> Sling explorer, if a property with a unicode value is added, double encodes it. This is valid for both the property name and value. Succesive values to edit it will, if the name is unicode, re-encode it giving longer and longer names...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2613) Sling explorer double encodes posted data

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476187#comment-13476187 ] 

Felix Meschberger commented on SLING-2613:
------------------------------------------

The explorer.js injects the _charset_ parameter before sending the post request (function $.post starting line 32 of explorer.js). I do not know, though, whether and how JQuery does parameter conversion (if at all).
                
> Sling explorer double encodes posted data
> -----------------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>
> Sling explorer, if a property with a unicode value is added, double encodes it. This is valid for both the property name and value. Succesive values to edit it will, if the name is unicode, re-encode it giving longer and longer names...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469685#comment-13469685 ] 

Santiago Gala commented on SLING-2613:
--------------------------------------

Summarizing: there are two different bugs:
- (/bundles/)explorer.js is not adding the _charset_ parameter, even if it looks like it is
- (documentation) the sling blog in 46 lines is not adding a _charset_ parameter, so it is not unicode-safe

The presence of those simulaneous bugs led me to incorrectly think that the problem was in "core" sling, which it is not.

Adding a line with the _charset_ parameter to the 46 lines blog, which would then be 47 unless something is removed, fixes it for the documentation. I'm trying to find how to send a patch for this.

Let's keep, then, this bug for the explorer. I'm renaming and editing the description, as, in a quick glance, I'm not finding how to fix it.


                
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling explorer double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Summary: Sling explorer double encodes posted data  (was: Sling double encodes posted data)
    
> Sling explorer double encodes posted data
> -----------------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Description: 
# start in a clean place
cd /tmp

rm -Rf sling

# download sling standalone (pick your own mirror if needed)
wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar

# run it in the background
java -jar org.apache.sling.launchpad-6-standalone.jar  &
pid=$!

# wait a couple of minutes for it to settle down
sleep 120 

curl http://localhost:8080/apps.tidy.json
#{
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}

# add a property
curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
#... blah blah ...

# recover it again...
curl http://localhost:8080/apps.tidy.json
#{
#  "español": "sánchez",
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}


# OOPS, it is doubly encoded...
# my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install

kill -1 $pid

  was:
# start in a clean place
cd /tmp

rm -Rf sling

# download sling standalone (pick your own mirror if needed)
wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar

# run it in the background
java -jar org.apache.sling.launchpad-6-standalone.jar  &
pid=$!

# wait a couple of minutes for it to settle down
sleep 120 

curl http://localhost:8080/apps.tidy.json
#{
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}

# add a property
curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
#... blah blah ...

# recover it again...
curl http://localhost:8080/apps.tidy.json
#{
#  "español": "sánchez",
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"



# OOPS, it is doubly encoded...
# my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install

kill -1 $pid

    
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Description: 
# start in a clean place
cd /tmp

rm -Rf sling

# download sling standalone (pick your own mirror if needed)
wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar

# run it in the background
java -jar org.apache.sling.launchpad-6-standalone.jar  &
pid=$!

# wait a couple of minutes for it to settle down
sleep 120 

curl http://localhost:8080/apps.tidy.json
#{
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}

# add a property
curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
#... blah blah ...

# recover it again...
curl http://localhost:8080/apps.tidy.json
#{
#  "español": "sánchez",
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"



# OOPS, it is doubly encoded...
# my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install

kill -1 $pid

  was:
# start in a clean place
cd /tmp

rm -Rf slinng

# download sling standalone (pick your own mirror if needed)
wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar

# run it in the background
java -jar org.apache.sling.launchpad-6-standalone.jar  &
pid=$!

# wait a couple of minutes for it to settle down
sleep 120 

curl http://localhost:8080/apps.tidy.json
#{
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}

# add a property
curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
#... blah blah ...

# recover it again...
curl http://localhost:8080/apps.tidy.json
#{
#  "español": "sánchez",
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"



# OOPS, it is doubly encoded...
# my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install

kill -1 $pid

    
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469450#comment-13469450 ] 

Santiago Gala edited comment on SLING-2613 at 10/5/12 2:21 AM:
---------------------------------------------------------------

It is failing for me in exactly the same way for any resource with ".explorer.html", and also with the "46 lines blog". This is my attempt to provide a reproducible test.

Your are right that it works with the __charset__ parameter.

So probably both the ajax explorer code and the 46 lines blog documentation need to be updated to reflect the need of such handling. I'm checking for it.
                
      was (Author: sgala):
    It is failing for me in exactly the same way for any resource with ".explorer.html", and also with the "46 lines blog". This is my attempt to provide a reproducible test.

Your are right that it works with the __charset__ parameter.

So probably both the explorer.esp code and the 46 lines blog documentation need to be updated to reflect the need of such handling. I'm checking for it.
                  
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469450#comment-13469450 ] 

Santiago Gala edited comment on SLING-2613 at 10/5/12 2:22 AM:
---------------------------------------------------------------

It is failing for me in exactly the same way for any resource with ".explorer.html", and also with the "46 lines blog". This is my attempt to provide a reproducible test.

Your are right that it works with the _charset_ parameter.

So probably both the ajax explorer code and the 46 lines blog documentation need to be updated to reflect the need of such handling. I'm checking for it.
                
      was (Author: sgala):
    It is failing for me in exactly the same way for any resource with ".explorer.html", and also with the "46 lines blog". This is my attempt to provide a reproducible test.

Your are right that it works with the __charset__ parameter.

So probably both the ajax explorer code and the 46 lines blog documentation need to be updated to reflect the need of such handling. I'm checking for it.
                  
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Attachment: sling-bug.sh

A shell script to (try to) reproduce the bug
                
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2613) Sling double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469450#comment-13469450 ] 

Santiago Gala commented on SLING-2613:
--------------------------------------

It is failing for me in exactly the same way for any resource with ".explorer.html", and also with the "46 lines blog". This is my attempt to provide a reproducible test.

Your are right that it works with the __charset__ parameter.

So probably both the explorer.esp code and the 46 lines blog documentation need to be updated to reflect the need of such handling. I'm checking for it.
                
> Sling double encodes posted data
> --------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> # start in a clean place
> cd /tmp
> rm -Rf sling
> # download sling standalone (pick your own mirror if needed)
> wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar
> # run it in the background
> java -jar org.apache.sling.launchpad-6-standalone.jar  &
> pid=$!
> # wait a couple of minutes for it to settle down
> sleep 120 
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # add a property
> curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
> #... blah blah ...
> # recover it again...
> curl http://localhost:8080/apps.tidy.json
> #{
> #  "español": "sánchez",
> #  "jcr:createdBy": "admin",
> #  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
> #  "jcr:primaryType": "sling:Folder"
> #}
> # OOPS, it is doubly encoded...
> # my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install
> kill -1 $pid

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling explorer double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Description: Sling explorer, if a property with a unicode value is added, double encodes it. This is valid for both the property name and value. Succesive values to edit it will, if the name is unicode, re-encode it giving longer and longer names...  (was: # start in a clean place
cd /tmp

rm -Rf sling

# download sling standalone (pick your own mirror if needed)
wget http://apache.rediris.es/sling/org.apache.sling.launchpad-6-standalone.jar

# run it in the background
java -jar org.apache.sling.launchpad-6-standalone.jar  &
pid=$!

# wait a couple of minutes for it to settle down
sleep 120 

curl http://localhost:8080/apps.tidy.json
#{
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}

# add a property
curl -D - -Ld "español=sánchez" http://admin:admin@localhost:8080/apps.tidy.json
#... blah blah ...

# recover it again...
curl http://localhost:8080/apps.tidy.json
#{
#  "español": "sánchez",
#  "jcr:createdBy": "admin",
#  "jcr:created": "Thu Oct 04 2012 15:23:35 GMT+0200",
#  "jcr:primaryType": "sling:Folder"
#}


# OOPS, it is doubly encoded...
# my locale is es_ES.UTF-8, a standard ubuntu 12.04.1 install

kill -1 $pid)
    
> Sling explorer double encodes posted data
> -----------------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> Sling explorer, if a property with a unicode value is added, double encodes it. This is valid for both the property name and value. Succesive values to edit it will, if the name is unicode, re-encode it giving longer and longer names...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2613) Sling explorer double encodes posted data

Posted by "Santiago Gala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Santiago Gala updated SLING-2613:
---------------------------------

    Component/s: Extensions
    
> Sling explorer double encodes posted data
> -----------------------------------------
>
>                 Key: SLING-2613
>                 URL: https://issues.apache.org/jira/browse/SLING-2613
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>         Environment: Ubuntu linux 12.04.1
>            Reporter: Santiago Gala
>              Labels: i18n
>         Attachments: sling-bug.sh
>
>
> Sling explorer, if a property with a unicode value is added, double encodes it. This is valid for both the property name and value. Succesive values to edit it will, if the name is unicode, re-encode it giving longer and longer names...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira