Encoding considerations for retrieval of XML data from a database

When you retrieve XML data from a Db2® table, you need to avoid data loss and truncation. Data loss can occur when characters in the source data cannot be represented in the encoding of the target data. Truncation can occur when conversion to the target data type results in expansion of the data.

Data loss is less of a problem for Java™ and .NET applications than for other types of applications because Java and .NET string data types use Unicode UTF-16 or UCS-2 encoding. Truncation is possible because expansion can occur when UTF-8 characters are converted to UTF-16 or UCS-2 encoding.