URIError when URI component is not propertly UTF-8 encoded in URI class #31

darronschall opened this Issue Jul 28, 2010 · 0 comments


None yet

1 participant


Originally filed by philoQE on 2007-07-30T23:56:02

What steps will reproduce the problem?

Add this code to URITest.as in corelib:

public function testUnescapingUnencodedChars() : void


              var s:String = "http://test.com/&&!%~ +=";

              assertTrue(URI.unescapeChars(s) == s);


What is the expected output? What do you see instead?

Brian comments: "The problem is in corelib's com.adobe.net.URI class.
Specifically, URI.unescapeChars calls the global decodeURIComponent, which
throws a URIError because the URI component is not properly UTF-8 encoded.
A reasonable solution is to put the call to decodeURIComponent within a
try-catch block and return the passed-in value if the call throws, perhaps
parametrize this with a throwIfIllegal param, which the URI getters should
set to false."

What version of the product are you using? On what operating system?
corelib-90.zip, Windows XP

Please provide any additional information below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment