You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2013/08/29 01:53:51 UTC

[jira] [Comment Edited] (LUCENE-5191) SimpleHTMLEncoder in Highlighter module breaks Unicode outside BMP

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

Uwe Schindler edited comment on LUCENE-5191 at 8/28/13 11:53 PM:
-----------------------------------------------------------------

Hi Walter,

I agree this could be used to fix, but its not useful here! There is no need to escape codepoints > 127. It just produces huge junks of escapes for all eastern languages! Escaping chars > 127 was done in the 1990s when web pages were not able to use other charsets than ISO-8859-1 or US-ASCII (and HTTP version 0.9 was not binary safe).
                
      was (Author: thetaphi):
    Hi Walter,

I agree this could be used to fix, but its not useful here! There is no need to escape codepoints > 127. It just produces huge junks of escapes for all eastern languages! Escaping chars > 127 was done in the 1990s when web pages were not able to use other charsets than ISO-8859-1 or US-ASCII.
                  
> SimpleHTMLEncoder in Highlighter module breaks Unicode outside BMP
> ------------------------------------------------------------------
>
>                 Key: LUCENE-5191
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5191
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/highlighter
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 5.0, 4.5
>
>         Attachments: LUCENE-5191.patch
>
>
> The highlighter provides a function to escape HTML, which does to much. To create valid HTML only ", <, >, & must be escaped, everything else can kept unescaped. The escaper unfortunately does also additionally escape everything > 127, which is unneeded if your web site has the correct encoding. It also produces huge amounts of HTML entities if used with eastern languages.
> This would not be a bugf if the escaping would be correct, but it isn't, it escapes like that:
> {{result.append("\&#").append((int)ch).append(";");}}
> So it escapes not (as HTML needs) the unicode codepoint, instead it escapes the UTF-16 char, which is incorrect, e.g. for our all-time favourite Deseret:
> U+10400 (deseret capital letter long i) would be escaped as {{&\#55297;&\#56320;}} and not as {{&\#66560;}}.
> So we should remove the stupid encoding of chars > 127 which is simply useless :-)
> See also: https://github.com/elasticsearch/elasticsearch/issues/3587

--
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org