[JBoss JIRA] (GTNCOMMON-24) FastURLDecoder cannot decode surrogate pair characters
by Peter Palaga (JIRA)
[ https://issues.jboss.org/browse/GTNCOMMON-24?page=com.atlassian.jira.plug... ]
Peter Palaga commented on GTNCOMMON-24:
---------------------------------------
Ah, please forget my previous comment. {{encoder.encode()}} actually decodes in spite of the method name so your original test case is correct.
> FastURLDecoder cannot decode surrogate pair characters
> ------------------------------------------------------
>
> Key: GTNCOMMON-24
> URL: https://issues.jboss.org/browse/GTNCOMMON-24
> Project: GateIn Common
> Issue Type: Bug
> Reporter: Takayuki Konishi
> Attachments: surrogatepairtest.patch
>
>
> FastURLDecoder cannot decode surrogate pair characters.
> When I decoded [U+20000B|http://www.fileformat.info/info/unicode/char/2000B/index.htm], I got MalformedInputException:
> {code}
> org.gatein.common.text.MalformedInputException: Cannot decode char 'A0'
> at org.gatein.common.text.FastURLDecoder.safeEncode(FastURLDecoder.java:217)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:45)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:62)
> at org.gatein.common.text.FastURLDecoderTestCase.testEncodeSurrogatePair(FastURLDecoderTestCase.java:159)
> {code}
> I also attach a patch for testcase.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 2 months
[JBoss JIRA] (GTNCOMMON-24) FastURLDecoder cannot decode surrogate pair characters
by Peter Palaga (JIRA)
[ https://issues.jboss.org/browse/GTNCOMMON-24?page=com.atlassian.jira.plug... ]
Peter Palaga edited comment on GTNCOMMON-24 at 2/27/15 6:08 AM:
----------------------------------------------------------------
[~tkonishi], the idea behind the attached test case is to compare the output of {{java.net.URLEncoder}} with the output of {{org.gatein.common.text.FastURLDecoder}}, right? But if this was your intention, then the test seems to be doing something different: it basically compares {{URLEncoder.encode(s, "UTF8")}} with {{FastURLDecoder.getUTF8Instance().encode(URLEncoder.encode(s, "UTF8"), out)}}. Note that the second expression encodes twice. Did you perhaps want something like this?
{code}
public void testEncodeSurrogatePair() throws Exception
{
FastURLDecoder encoder = FastURLDecoder.getUTF8Instance();
CharBuffer out = new CharBuffer();
StringBuilder sb = new StringBuilder( 2 );
sb.append( ( char ) 0xD840 );
sb.append( ( char ) 0xDC0B );
String hanU2000B = sb.toString(); // U+2000B
String encodedWithURLEncoder = URLEncoder.encode(hanU2000B, "UTF8");
encoder.encode(hanU2000B, out);
assertEquals(encodedWithURLEncoder, out.asString());
}
{code}
was (Author: ppalaga):
[~tkonishi], the idea behind the attached test case is to compare the output of {{java.net.URLEncoder}} with the output of {{org.gatein.common.text.FastURLDecoder}}. But if this was your intention, then the test seems to be doing something different: it basically compares {{URLEncoder.encode(s, "UTF8")}} with {{FastURLDecoder.getUTF8Instance().encode(URLEncoder.encode(s, "UTF8"), out)}}. Note that the second expression encodes twice. Did you perhaps want something like this?
{code}
public void testEncodeSurrogatePair() throws Exception
{
FastURLDecoder encoder = FastURLDecoder.getUTF8Instance();
CharBuffer out = new CharBuffer();
StringBuilder sb = new StringBuilder( 2 );
sb.append( ( char ) 0xD840 );
sb.append( ( char ) 0xDC0B );
String hanU2000B = sb.toString(); // U+2000B
String encodedWithURLEncoder = URLEncoder.encode(hanU2000B, "UTF8");
encoder.encode(hanU2000B, out);
assertEquals(encodedWithURLEncoder, out.asString());
}
{code}
> FastURLDecoder cannot decode surrogate pair characters
> ------------------------------------------------------
>
> Key: GTNCOMMON-24
> URL: https://issues.jboss.org/browse/GTNCOMMON-24
> Project: GateIn Common
> Issue Type: Bug
> Reporter: Takayuki Konishi
> Attachments: surrogatepairtest.patch
>
>
> FastURLDecoder cannot decode surrogate pair characters.
> When I decoded [U+20000B|http://www.fileformat.info/info/unicode/char/2000B/index.htm], I got MalformedInputException:
> {code}
> org.gatein.common.text.MalformedInputException: Cannot decode char 'A0'
> at org.gatein.common.text.FastURLDecoder.safeEncode(FastURLDecoder.java:217)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:45)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:62)
> at org.gatein.common.text.FastURLDecoderTestCase.testEncodeSurrogatePair(FastURLDecoderTestCase.java:159)
> {code}
> I also attach a patch for testcase.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 2 months
[JBoss JIRA] (GTNCOMMON-24) FastURLDecoder cannot decode surrogate pair characters
by Peter Palaga (JIRA)
[ https://issues.jboss.org/browse/GTNCOMMON-24?page=com.atlassian.jira.plug... ]
Peter Palaga commented on GTNCOMMON-24:
---------------------------------------
[~tkonishi], the idea behind the attached test case is to compare the output of {{java.net.URLEncoder}} with the output of {{org.gatein.common.text.FastURLDecoder}}. But if this was your intention, then the test seems to be doing something different: it basically compares {{URLEncoder.encode(s, "UTF8")}} with {{FastURLDecoder.getUTF8Instance().encode(URLEncoder.encode(s, "UTF8"), out)}}. Note that the second expression encodes twice. Did you perhaps want something like this?
{code}
public void testEncodeSurrogatePair() throws Exception
{
FastURLDecoder encoder = FastURLDecoder.getUTF8Instance();
CharBuffer out = new CharBuffer();
StringBuilder sb = new StringBuilder( 2 );
sb.append( ( char ) 0xD840 );
sb.append( ( char ) 0xDC0B );
String hanU2000B = sb.toString(); // U+2000B
String encodedWithURLEncoder = URLEncoder.encode(hanU2000B, "UTF8");
encoder.encode(hanU2000B, out);
assertEquals(encodedWithURLEncoder, out.asString());
}
{code}
> FastURLDecoder cannot decode surrogate pair characters
> ------------------------------------------------------
>
> Key: GTNCOMMON-24
> URL: https://issues.jboss.org/browse/GTNCOMMON-24
> Project: GateIn Common
> Issue Type: Bug
> Reporter: Takayuki Konishi
> Attachments: surrogatepairtest.patch
>
>
> FastURLDecoder cannot decode surrogate pair characters.
> When I decoded [U+20000B|http://www.fileformat.info/info/unicode/char/2000B/index.htm], I got MalformedInputException:
> {code}
> org.gatein.common.text.MalformedInputException: Cannot decode char 'A0'
> at org.gatein.common.text.FastURLDecoder.safeEncode(FastURLDecoder.java:217)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:45)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:62)
> at org.gatein.common.text.FastURLDecoderTestCase.testEncodeSurrogatePair(FastURLDecoderTestCase.java:159)
> {code}
> I also attach a patch for testcase.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 2 months
[JBoss JIRA] (GTNCOMMON-24) FastURLDecoder cannot decode surrogate pair characters
by Peter Palaga (JIRA)
[ https://issues.jboss.org/browse/GTNCOMMON-24?page=com.atlassian.jira.plug... ]
Peter Palaga commented on GTNCOMMON-24:
---------------------------------------
"U+20000B" above is linked to U+2000B (one zero character less). I guess U+2000B is correct?
> FastURLDecoder cannot decode surrogate pair characters
> ------------------------------------------------------
>
> Key: GTNCOMMON-24
> URL: https://issues.jboss.org/browse/GTNCOMMON-24
> Project: GateIn Common
> Issue Type: Bug
> Reporter: Takayuki Konishi
> Attachments: surrogatepairtest.patch
>
>
> FastURLDecoder cannot decode surrogate pair characters.
> When I decoded [U+20000B|http://www.fileformat.info/info/unicode/char/2000B/index.htm], I got MalformedInputException:
> {code}
> org.gatein.common.text.MalformedInputException: Cannot decode char 'A0'
> at org.gatein.common.text.FastURLDecoder.safeEncode(FastURLDecoder.java:217)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:45)
> at org.gatein.common.text.AbstractCharEncoder.encode(AbstractCharEncoder.java:62)
> at org.gatein.common.text.FastURLDecoderTestCase.testEncodeSurrogatePair(FastURLDecoderTestCase.java:159)
> {code}
> I also attach a patch for testcase.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 2 months
[JBoss JIRA] (GTNPORTAL-3524) Custom portals cannot use remote portlets
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3524?page=com.atlassian.jira.pl... ]
RH Bugzilla Integration commented on GTNPORTAL-3524:
----------------------------------------------------
Juraci Paixao Krohling <jcosta(a)redhat.com> changed the Status of [bug 1122527|https://bugzilla.redhat.com/show_bug.cgi?id=1122527] from ASSIGNED to POST
> Custom portals cannot use remote portlets
> -----------------------------------------
>
> Key: GTNPORTAL-3524
> URL: https://issues.jboss.org/browse/GTNPORTAL-3524
> Project: GateIn Portal
> Issue Type: Bug
> Components: WSRP integration
> Reporter: Juraci Paixão Kröhling
> Assignee: Juraci Paixão Kröhling
> Fix For: 3.9.0.Final
>
>
> Before GTNPORTAL-3291, the FederatingPortletInvoker was shared among all contexts, meaning that a PortletInvoker responsible for local portlets was the same on "portal" and on "sample-portal". Similarly, a WSRP PortletInvoker was also shared.
> This caused the problems described in 3291 and 2700 and a fix was issued in that each context would have it's own FederatingPortletInvoker .
> With local portlets, each context having its own FederatingPortletInvoker is not a big issue, because the query is made at the JCR level for which portlets are available.
> With remote portlets, it's a problem, as WSRP registers the consumers only once, for the "portal" context. This means that the consumer invokers are not available for non-"portal" contexts. With this, a call from the context "sample-portal" to the FederatingPortletInvoker, requesting portlet "selfv2.bla" would fail, as there's no way to find this portlet on this particular invoker tree.
> While the producers are also started for the "portal" context, the fact that producers have their own servlet context makes it immune from this bug, as all HTTP calls to the producers reaches a context whose invoker *knows* about the requested portlet. In other words: producers are not affected by this bug.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 2 months
[JBoss JIRA] (GTNPORTAL-3524) Custom portals cannot use remote portlets
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3524?page=com.atlassian.jira.pl... ]
RH Bugzilla Integration updated GTNPORTAL-3524:
-----------------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1122527
> Custom portals cannot use remote portlets
> -----------------------------------------
>
> Key: GTNPORTAL-3524
> URL: https://issues.jboss.org/browse/GTNPORTAL-3524
> Project: GateIn Portal
> Issue Type: Bug
> Components: WSRP integration
> Reporter: Juraci Paixão Kröhling
> Assignee: Juraci Paixão Kröhling
> Fix For: 3.9.0.Final
>
>
> Before GTNPORTAL-3291, the FederatingPortletInvoker was shared among all contexts, meaning that a PortletInvoker responsible for local portlets was the same on "portal" and on "sample-portal". Similarly, a WSRP PortletInvoker was also shared.
> This caused the problems described in 3291 and 2700 and a fix was issued in that each context would have it's own FederatingPortletInvoker .
> With local portlets, each context having its own FederatingPortletInvoker is not a big issue, because the query is made at the JCR level for which portlets are available.
> With remote portlets, it's a problem, as WSRP registers the consumers only once, for the "portal" context. This means that the consumer invokers are not available for non-"portal" contexts. With this, a call from the context "sample-portal" to the FederatingPortletInvoker, requesting portlet "selfv2.bla" would fail, as there's no way to find this portlet on this particular invoker tree.
> While the producers are also started for the "portal" context, the fact that producers have their own servlet context makes it immune from this bug, as all HTTP calls to the producers reaches a context whose invoker *knows* about the requested portlet. In other words: producers are not affected by this bug.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 2 months