decode-mime-entity
The decode-mime-entity function returns a string that represents the MIME entity decoded using the charset parameter included in the Content-Type header of the entity. If no charset was specified, you can supply a default encoding, by connecting the desired string value to the default-encoding parameter.

Languages
Built-in.
Parameters
Name | Type | Description |
---|---|---|
mime-entity | mf:MimeEntity | The MIME entity to be decoded. |
default-encoding | xs:string | The default encoding to use when no encoding was specified in the charset parameter. |
Example
The following mapping calls a Web service that returns JSON content.

When this mapping runs, the result of the Web service call is supplied as input to the decode-mime-entity function. The function decodes the "raw" body returned by the call according to the charset parameter of the Content-Type header. The result is as follows:
