You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Ben Fortuna <be...@gmail.com> on 2016/08/16 07:17:56 UTC

HTMLSerializer and unicode characters

Hi everyone,

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:

&#x1F601; becomes &#xD83C;&#xDE01;

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.

Is anyone familiar with using unicode characters in sling, and is there any
special configuration required? Many thanks.

regards,
ben

Re: HTMLSerializer and unicode characters

Posted by Ben Fortuna <be...@gmail.com>.
Hi Stefan,

Thanks for the quick reply. I've created a JIRA issue here:

https://issues.apache.org/jira/browse/SLING-5973

regards,
ben


On 17 August 2016 at 02:18, Stefan Seifert <ss...@pro-vision.de> wrote:

> hello ben.
>
> difficult to say without further context, unlikely that we have such a
> major problem in the codebase which is used for a long time. in general
> sling should support unicode character everywhere without problems.
>
> can you create a trivial sample project that reproduces the problem e.g.
> in sling Launchpad, and create a sling JIRA ticket with the steps to
> reproduce the problem?
>
> stefan
>
>
> >-----Original Message-----
> >From: Ben Fortuna [mailto:benfortuna@gmail.com]
> >Sent: Tuesday, August 16, 2016 9:18 AM
> >To: users@sling.apache.org
> >Subject: HTMLSerializer and unicode characters
> >
> >Hi everyone,
> >
> >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:
> >
> >&#x1F601; becomes &#xD83C;&#xDE01;
> >
> >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.
> >
> >Is anyone familiar with using unicode characters in sling, and is there
> any
> >special configuration required? Many thanks.
> >
> >regards,
> >ben
>

RE: HTMLSerializer and unicode characters

Posted by Stefan Seifert <ss...@pro-vision.de>.
hello ben.

difficult to say without further context, unlikely that we have such a major problem in the codebase which is used for a long time. in general sling should support unicode character everywhere without problems.

can you create a trivial sample project that reproduces the problem e.g. in sling Launchpad, and create a sling JIRA ticket with the steps to reproduce the problem?

stefan


>-----Original Message-----
>From: Ben Fortuna [mailto:benfortuna@gmail.com]
>Sent: Tuesday, August 16, 2016 9:18 AM
>To: users@sling.apache.org
>Subject: HTMLSerializer and unicode characters
>
>Hi everyone,
>
>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:
>
>&#x1F601; becomes &#xD83C;&#xDE01;
>
>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.
>
>Is anyone familiar with using unicode characters in sling, and is there any
>special configuration required? Many thanks.
>
>regards,
>ben