Salesforce Certified Marketing Cloud Engagement Developer free question 5 / 10 · Domain 2: Programmatic Languages
A developer hashes a value with MD5("sub-4821") and passes no second parameter. Which character set does the function use to encode the string?
- The character set of the sendable data extension, as the function reads it from the send
- UTF-16, as the function encodes with the wider character set by default
- UTF-8, as that is the default and UTF-16 is the other accepted value
- ASCII, as the function hashes the plain bytes of the string
Show the answer and explanation
Answer: C
Why this is correct
MD5() converts a string to a 128-bit hexadecimal MD5 hash. Its optional charSet parameter accepts UTF-8 and UTF-16, and the default is UTF-8. A value hashed with UTF-16 gives a different hash from the same value hashed with UTF-8.
Why the other options are wrong
"UTF-16, as the function encodes with the wider character set by default" … The page says the default value is UTF-8. UTF-16 is used when you pass it as the charSet parameter.
"ASCII, as the function hashes the plain bytes of the string" … The accepted values of the character set parameter are UTF-8 and UTF-16. ASCII is not listed.
"The character set of the sendable data extension, as the function reads it from the send" … The function takes its character set from the optional charSet parameter, and its default is UTF-8.
Key point
MD5() encodes with UTF-8 unless you pass UTF-16.