Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pcon
Created August 19, 2014 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcon/c34dcb7d3f219e3fde02 to your computer and use it in GitHub Desktop.
Save pcon/c34dcb7d3f219e3fde02 to your computer and use it in GitHub Desktop.
EncodingUtils weirdness
System.debug(System.LoggingLevel.ERROR, '| vs ' + EncodingUtil.urlDecode('%7C;', 'UTF-8'));
if ('|' == EncodingUtil.urlDecode('%7C', 'UTF-8')) {
System.debug(System.LoggingLevel.ERROR, 'Expected: %7C');
} else {
System.debug(System.LoggingLevel.ERROR, 'Unxpected: %7C');
}
System.debug(System.LoggingLevel.ERROR, '| vs ' + EncodingUtil.urlDecode('|', 'UTF-8'));
if ('|' == EncodingUtil.urlDecode('|', 'UTF-8')) {
System.debug(System.LoggingLevel.ERROR, 'Expected: |');
} else {
System.debug(System.LoggingLevel.ERROR, 'Unxpected: &#124');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment