Choosing the Appropriate String Class Interface
The Essential Tools Module provides string classes that allow you to build your XML streams in UTF-8 and UTF-16. (For more detailed information on the encodings supported by the Essential Tools Module, see When You Do Not Need the Internationalization Module.)
These classes are RWCString, RWWString, and RWBasicUString.
*The RWCString and narrow character interface takes and produces UTF-8 encoded characters. The system does not, however, validate the data as UTF-8. Therefore, it is possible to insert characters using some other encoding, but the resulting document is not guaranteed valid.
NOTE: Be aware that the XML Streams Module does not validate for UTF-8, so if you use another encoding with a narrow-character inserter or extractor, the resulting document may not be valid.
If you are using RWCString and you need UTF-16 encoded characters, you may convert to and from UTF-8 and UTF-16. For information on UTF-8 to UTF-16 conversions, see Converting to and from UTF-8 and UTF-16 .
*The RWWString and wide character interface take and produce UTF-16 encoded characters. Wide character data must be encoded in UTF-16 before insertion into an XML output stream.
*The RWBasicUString and Unicode interface take and produce UTF-16 encoded characters. Using RWBasicUString from the Essential Tools Module is the recommended and easiest way to insert or extract UTF-16 strings because it is the base class for the Internationalization Module’s RWUString. RWUString’s functionality has been extended to convert UTF-16 to and from any encoding. If you are using RWBasicUString and decide that you need the Internationalization Module’s code conversion functionality, you can easily change to RWUStrings.
NOTE: Using RWBasicUString for your UTF-16 strings is the recommended method over a conventional wide-character interface.