[
https://issues.apache.org/jira/browse/SLING-5973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426918#comment-15426918
]
Oliver Lietz commented on SLING-5973:
-------------------------------------
bq. escaping in form {{&\#x2602;}} is HTML specific and not compatible with the
JSON spec.
[[email protected]], the HTML entities are just strings in JSON also. Why
should they not be compatible? I think it's absolutely fine to put HTML in JSON
strings (as long following the simple escape rules from RFC 4627 2.5).
{quote}
2.5. Strings
The representation of strings is similar to conventions used in the C
family of programming languages. A string begins and ends with
quotation marks. All Unicode characters may be placed within the
quotation marks except for the characters that must be escaped:
quotation mark, reverse solidus, and the control characters (U+0000
through U+001F).
{quote}
> HTMLSerializer not handling some unicode characters (emoji, etc.)
> -----------------------------------------------------------------
>
> Key: SLING-5973
> URL: https://issues.apache.org/jira/browse/SLING-5973
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Reporter: Ben Fortuna
> Attachments: emoji-no-sling-rewriter.png,
> emoji-with-sling-rewriter.png
>
>
> I've noticed that when I have unicode special characters (e.g. emoji) in my
> sling content and the sling rewriter is enabled the characters are not output
> correctly to the browser. For example:
> {code}😁{code} becomes {code}��{code}
> If I disable the rewriter pipeline the output is as expected.
> I've looked in the code and I suspect the issue is in the HTMLSerializer from
> the Cocoon library, however I'm not sure why as it should be using the
> default encoding for output (which is UTF-8). My rewriter pipeline is using
> the default html-generator and html-serializer provided by sling.
> My code is available on GitHub here:
> https://github.com/Whistlepost/emojistrip
> It provides a very simple app/content project pair with some emoji characters
> in the content (see src/main/resources/SLING-INF/content/phrases.json). Many
> thanks.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)