apache-flexactionscriptflex3encoderfc2396

Flex encode string according to RFC RFC 2396


How can I encode a string according to RFC 2396, using Actionscript/Flex 3?

Thanks in advance!


Solution

  • Similar to Javascript, in Actionscript you can use the following top level (or global) functions to encode/decode URI's:

    encodeUri() encodeURIComponent() decodeURI() and decodeURIComponent()

    As well as:

    escape() unescape()

    There are subtle differences between these 6 global functions, check the links to the docs above. Here's an article that discusses the difference in Javascript, but it should be the same for Actionscript.