myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeanne Waldman (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (TRINIDAD-2377) surrogate characters in outputFormatted throws IllegalArgumentException
Date Fri, 12 Apr 2013 05:09:17 GMT

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

Jeanne Waldman commented on TRINIDAD-2377:
------------------------------------------

Changed code from
        // only increase i if a valid surrogate code point is returned 
        if (Character.isSupplementaryCodePoint(surrogateCodePoint))
        {
        buffIndex =
            _writeDecRef(out, buff, buffIndex, surrogateCodePoint);

          i++;
        }
        else
        {
          throw new IllegalArgumentException(
            _LOG.getMessage("INVALID_SURROGATE_CHAR", new Object[] { ch, surrogateCodePoint,
i }));
        }
to
        buffIndex =
            _writeDecRef(out, buff, buffIndex, surrogateCodePoint);
        // only increase i if a valid surrogate code point is returned 
        if (Character.isSupplementaryCodePoint(surrogateCodePoint))
        {
          i++;
        }
        else
        {
          // DO NOT BLOW UP. We have a bug in outputFormatted+surrogates, and we don't want
to blow up.
          // blow up if invalid utf-16 characters encountered
          //throw new IllegalArgumentException(
          //  _LOG.getMessage("INVALID_SURROGATE_CHAR", new Object[] { ch, surrogateCodePoint,
i }));
        }
                
> surrogate characters in outputFormatted throws IllegalArgumentException
> -----------------------------------------------------------------------
>
>                 Key: TRINIDAD-2377
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2377
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>            Reporter: Jeanne Waldman
>            Assignee: Jeanne Waldman
>         Attachments: TRINIDAD-SurrogateOutputFormattedPatch.patch
>
>
> <af:outputFormatted value="#{TestInput.surrogateVal}" id="of1"/> 
> where
> TestInput.surrogateValue is a surrogateValue, like
>   private String surrogateVal = "\ud840\udc00";
>   public void setSurrogateVal(String surrogateVal) {
>       this.surrogateVal = surrogateVal;
>   }
>   public String getSurrogateVal() {
>       return surrogateVal;
> The page shows up blank, and you get an IllegalArgumentException from HTMLEscapes. outputText
works fine. This is a regression caused by MYFACES-3690 Trinidad doesn't support surrogate
characters

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

Mime
View raw message