You are currently reviewing an older revision of this page.

KB-XXXX Web APIs return special characters as question marks

Symptoms

When querying a Web API, some special characters, such as the em dash (–), are incorrectly interpreted by clients such as SoapUI and Postman as question marks or other symbols of incompatibility, while Appian displays them as expected.

Result in Appian

Result in Appian

Result in Client

Result in Postman

Cause

This issue is caused by the Web API not sending an appropriate Content-Type header with a character set included, which the client system relies on to interpret the content sent by the Web API.

Action

Explicitly specify the Content-Type header with the relevant character set in the SAIL code for the Web API using a!httpHeader in the headers parameter of the a!httpResponse. For example, to correctly send JSON with the UTF-8 character set (which supports the em dash character), include the following:

headers: {
a!httpHeader(
name: "Content-Type",
value: "application/json; charset=utf-8"
)
}

Note that if the source data itself does not support these special characters, for example due to querying a database with a restrictive character set and collation, including the header will not resolve this. If this is the case, Appian will also fail to render the characters as expected.

Affected Versions

This article applies to Appian 7.9 and later.

Last Reviewed: January 2019