Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent Flash's URLRequest from escaping the url?

I load some XML from a servlet from my Flex application like this:

_loader = new URLLoader();
_loader.load(new URLRequest(_servletURL+"?do=load&id="+_id));

As you can imagine _servletURL is something like http://foo.bar/path/to/servlet

In some cases, this URL contains accented characters (long story). I pass the unescaped string to URLRequest, but it seems that flash escapes it and calls the escaped URL, which is invalid. Ideas?

like image 224
Peldi Guilizzoni Avatar asked Jan 24 '23 03:01

Peldi Guilizzoni


1 Answers

My friend Luis figured it out:

You should use encodeURI does the UTF8URL encoding http://livedocs.adobe.com/flex/3/langref/package.html#encodeURI()

but not unescape because it unescapes to ASCII see http://livedocs.adobe.com/flex/3/langref/package.html#unescape()

I think that is where we are getting a %E9 in the URL instead of the expected %C3%A9.

http://www.w3schools.com/TAGS/ref_urlencode.asp

like image 55
Mark Miller Avatar answered Feb 01 '23 15:02

Mark Miller