com.HttpServiceRequest.setResponseCharset

Defines the HTTP response character set.

Syntax

setResponseCharset(
   charset STRING )
  1. charset defines the HTTP response character set.

Usage

The setResponseCharset() method defines the character set to use when sending an HTTP response.

The server must send a response in a character set that the client understands.

If the response character set is not defined by setResponseCharset(), the same character set as the client request is used, or the implicit ISO-8859-1 charset is used if the character is not defined by the client request. If the data to be return is application/json, the response will be in UTF-8.

The method must be called before sending the response with one of sendResponse, sendTextResponse, sendXmlResponse, or beginXmlResponse and endXmlResponse methods.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).