Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Advanced Tools Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

8.2 Determining your Character Encoding Needs

Depending on your character encoding, you may or may not need the full power of the Internationalization Module. Because building and linking the Internationalization Module also links the entire International Consortium of Unicode (ICU) libraries, it is wise to first evaluate your encoding needs.

8.2.1 The Advanced Tools Module's Character Encoding Requirements

The Advanced Tools Module imposes no internal character encoding requirements or restrictions. Streams may be built in any character encoding. This means that you do not need to convert your characters or data in or out of any particular encoding to use the classes in the Advanced Tools Module.

You do, however, need to assess whether or not you'll need to build and link the Internationalization Module, based on the character encoding of your streams.

This section provides an overview to help you evaluate your character encoding requirements.

8.2.2 When You Do Not Need the Internationalization Module

You do not need the Internationalization Module if you know you will be building streams in one of the following encodings:

SourcePro's regular string and stream processing classes can accommodate these five encodings without linking the Internationalization Module.

The Advanced Tools Module also contains classes to support converting streams between UTF-8 and UTF-16. For more information, see Section 8.3.1.2, "Unicode Converter Classes," in this chapter.

If you need conversion to and from other encodings, or more advanced manipulation of strings in UTF-16, you will want to use the Internationalization Module.

8.2.3 When You Do Need the Internationalization Module

If you are building and serializing streams in other encodings than those listed in the previous Section 8.2.2, you must build and link the Internationalization Module. The Internationalization Module can convert a byte stream to and from any recognized character encoding and UTF-16, and offers advanced manipulation of strings, such as collation, Unicode regular expression searches, and resource bundles.

8.2.4 Choosing the Appropriate String Class

If you know you will be using UTF-8 only, use RWCString from the Essential Tools Module.

If you are using UTF-16 characters but do not need the Internationalization Module, use RWBasicUString from the Essential Tools Module. (See Section 8.2.2, "When You Do Not Need the Internationalization Module.") RWBasicUString holds a UTF-16 string and can convert between UTF-8 and UTF-16. Because RWUString from the Internationalization Module is derived from RWBasicUString, using RWBasicUString would allow you to take advantage of the wide range of encodings supported by RWUString with minimal code changes, should you need to do so at a future time.

For more information on using RWBasicUString, see the Essential Tools Module User's Guide.


Using RWBasicUString for your UTF-16 strings is the recommended method over a conventional wide-character interface such as that offered by RWWString.

If you need to perform conversions to or from character encodings other than -UTF-8 and UTF-16 and will therefore require the Internationalization Module, use that module's RWUString. Through its conversion utilities, RWUString provides the ability to convert between UTF-16 and any recognized character encoding. For more information on using this class, see the Internationalization Module User's Guide.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.