[jboss-jira] [JBoss JIRA] (ELY-139) ByteStringBuilder.appendUtf8Raw() cannot append lonely surrogates

Jan Kalina (JIRA) issues at jboss.org
Fri Jan 30 04:48:49 EST 2015


     [ https://issues.jboss.org/browse/ELY-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Kalina updated ELY-139:
---------------------------
    Description: 
ByteStringBuilder cannot append codepoints 0xD8xx (lonely surrogates). It should - StringBuilder.appendCodePoint() work with it.
(Problem is only with uncomplete/nonvalid unicode strings, so it is not critical problem.)

Mentioned in: https://github.com/wildfly-security/wildfly-elytron/pull/101

**UPDATE:**
ByteStringBuilder encode surrogates correctly by RFC3629 (if we ignore they are prohibited because they are reserved for UTF-16). Conversly StringBuilder and `(char)` operator encode D800-D8FF bad as 3F.

Problem is only in appending into ByteStringBuilder constructed as:
        new ByteStringBuilder(new byte[]{});


  was:
ByteStringBuilder cannot append codepoints 0xD8xx (lonely surrogates). It should - StringBuilder.appendCodePoint() work with it.
(Problem is only with uncomplete/nonvalid unicode strings, so it is not critical problem.)

Mentioned in: https://github.com/wildfly-security/wildfly-elytron/pull/101



> ByteStringBuilder.appendUtf8Raw() cannot append lonely surrogates
> -----------------------------------------------------------------
>
>                 Key: ELY-139
>                 URL: https://issues.jboss.org/browse/ELY-139
>             Project: WildFly Elytron
>          Issue Type: Bug
>            Reporter: Jan Kalina
>            Assignee: Jan Kalina
>            Priority: Minor
>
> ByteStringBuilder cannot append codepoints 0xD8xx (lonely surrogates). It should - StringBuilder.appendCodePoint() work with it.
> (Problem is only with uncomplete/nonvalid unicode strings, so it is not critical problem.)
> Mentioned in: https://github.com/wildfly-security/wildfly-elytron/pull/101
> **UPDATE:**
> ByteStringBuilder encode surrogates correctly by RFC3629 (if we ignore they are prohibited because they are reserved for UTF-16). Conversly StringBuilder and `(char)` operator encode D800-D8FF bad as 3F.
> Problem is only in appending into ByteStringBuilder constructed as:
>         new ByteStringBuilder(new byte[]{});



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list