Sunday, August 14, 2011

An Issue With URLs

There is an issue with character encoding in the two SAS functions for URLs, URLENCODE and URLDECODE. URLs are uniform resource locators used on the Internet, such as web addresses. To work correctly, they need to be presented in the character encoding the Internet runs on, UTF-8. Yet SAS, as of release 9.3, has limited support for UTF-8, so the arguments to the URL functions might also be in the SAS session encoding.

To get around this potential stumbling block, there is a new system option in SAS 9.3 that lets you indicate the encoding of the argument to the URL functions. Set the option URLENCODING=SESSION if the argument is in the session encoding or URLENCODING=UTF8 if it is in UTF-8 encoding.

No comments:

Post a Comment