No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
EncodingUtil Class
Namespace
Usage
EncodingUtil Methods
The following are methods for EncodingUtil. All methods are static.
convertFromHex(String)
Signature
public static Blob convertToHex(String inputString)
Parameters
- inputString
- Type: String
- The hexadecimal string to convert. The string can contain only valid hexadecimal characters (0-9, a-f, A-F) and must have an even number of characters.
Return Value
Type: Blob
Usage
Each byte in the Blob is constructed from two hexadecimal characters in the input string.
The convertFromHex method throws the following exceptions.
- NullPointerException — the inputString is null.
- InvalidParameterValueException — the inputString contains invalid hexadecimal characters or doesn’t contain an even number of characters.
Example
1swfobject.registerObject("clippy.codeblock-0", "9");Blob blobValue = EncodingUtil.convertFromHex('4A4B4C');
2System.assertEquals('JKL', blobValue.toString());convertToHex(Blob)
Signature
public static String convertToHex(Blob inputString)
Parameters
- inputString
- Type: Blob
Return Value
Type: String
urlDecode(String, String)
Signature
public static String urlDecode(String inputString, String encodingScheme)
Return Value
Type: String
Usage
This method uses the supplied encoding scheme to determine which characters are represented by any consecutive sequence of the from \"%xy\". For more information about the format, see The form-urlencoded Media Type in Hypertext Markup Language - 2.0.
urlEncode(String, String)
Signature
public static String urlEncode(String inputString, String encodingScheme)
Return Value
Type: String
Usage
This method uses the supplied encoding scheme to obtain the bytes for unsafe characters. For more information about the format, see The form-urlencoded Media Type in Hypertext Markup Language - 2.0.
Example
1String encoded = EncodingUtil.urlEncode(url, 'UTF-8');