Working with XML-Restricted Characters

You can store data in Amazon SimpleDB through the REST and SOAP interfaces. All results are returned in XML documents.

XML does not support certain Unicode characters. For information on specific characters, go to section 2.1 of the XML 1.1 specification.

Because it is XML-based, you cannot submit these characters through the SOAP API. However, you can accidentally send them through the REST API.

To ensure that you can read all the data you sent via REST, if a response contains invalid XML characters, Amazon SimpleDB automatically Base64-encodes the UTF-8 octets of the text.

When a returned element is Base64-encoded, its encoding element is set to base64. The following example shows Base64-encoded results from a GetAttributes operation.

<Attribute><Name encoding="base64">...</Name></Attribute>
<Attribute><Value encoding="base64">...</Value></Attribute>
<Item><Name encoding="base64">...</Name></Item>

The following example shows Base64-encoded results from a Query operation.

<ItemName encoding="base64">...</ItemName>

When designing your application, make sure to scrub any data for invalid characters or design your application to handle Base64-encoded results.