URI should use escape/unescape (ascii) as opposed to encode/decodeURI (UTF8) #186

Open
spotco opened this Issue Jun 12, 2012 · 0 comments

Projects

None yet

1 participant

@spotco
spotco commented Jun 12, 2012

var u:URI = new URI("http://test.com/");
u.chdir("al%e9atoire/");

currently this breaks (%e9 isn't UTF-8, it's ascii) with an exception from decodeURI
http://www.w3schools.com/tags/ref_urlencode.asp
http://www.utf8-chartable.de/

The way I fixed this was changing these two functions in URI.as:

    static public function unescapeChars(escaped:String /*, onlyHighASCII:Boolean = false*/) : String {
        return unescape(escaped);
    }

    static public function fastEscapeChars(unescaped:String, bitmap:URIEncodingBitmap) : String {
        return escape(unescaped);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment