Skip to main content

Character Encoding in Advar Responses

When special characters are used in creative field values, the Adhese ad response (advars) does not always return them as-is. This page describes the current encoding behavior so integrators can correctly process the ad.tag property and display these values.

Character processed without change

! @ # $ % ^ * ( ) : ; | ? / , . ~ `

Always entity-encoded

Regardless of account configuration, the following characters are always encoded:

character name encoded as
& ampersand &
" double quote "
example: encoding
"Abc" K&L "Abc" K&L

Single quote: controlled by the escapeAdvarStrategy setting

How a single quote (') is encoded depends on the account's escapeAdvarStrategy configuration property. This property exists because a single, universal escaping approach doesn't work for every delivery format:

    the HTML entity ’ only decodes correctly in HTML contexts — in native or JSON tags it would otherwise show up to the end user as literal entity text.
    value of escapeAdvarStrategy
    behavior example: O'Brien
    raw No escaping — the quote is passed through as-is O'Brien
    html HTML-entity escaping O’Brien
    accent The quote is replaced with an acute accent (´) — a visual substitution, not a true escape O´Brien

    Fallback: if escapeAdvarStrategy is unset, blank, or set to an unrecognized value, the account falls back to its legacy escapeAdvarParams boolean: false behaves like raw, and true (the default) behaves like html.

    Accounts that haven't set escapeAdvarStrategy are unaffected and continue to behave exactly as before.

    Integrators should decode a value according to the account's configured strategy before displaying it. For an account using html (the default), a value containing T&T is returned as T&T and should be decoded back to T&T; a value containing O'Brien is returned as O’Brien and should be decoded back to O'Brien.

    Unsupported characters

    The following characters currently cannot be saved in a creative field:

    character name behavior
    \ backslash Results in a malformed value in the ad response
    < less than sign Not accepted when saving the creative
    > more than sign Not accepted when saving the creative

    AvoidDon't usinguse these characters in field values.values!

    Note

    Encoding behavior is subject to change; this page will be updated if the rules above change.