KB-1851 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. The client displays these characters as question marks or other symbols of incompatibility, while Appian displays them as expected.

Result in Appian

Result in Client

Cause

This occurs when the Web API does not send 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: 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 have no effect. 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

Related
Recommended