Built-in String Converters in C++98

Ice provides three string converters to cover common conversion requirements:

  • The Unicode wstring converter
    This is a string converter that converts between Unicode wide strings and UTF-8 strings. Unless you install a different string converter, this is the default converter that is used for wide strings.
  • The iconv string converter (Linux, macOS, Unix)
    The iconv string converter converts strings using the iconv conversion facility. It can be used to convert either wide or narrow strings.
  • The Windows string converter (Windows only)
    This string converter converts between multi-byte and UTF-8 strings and uses MultiByteToWideChar and WideCharToMultiByte for its implementation.

These string converters can be created through factory functions in the Ice namespace:

namespace Ice
    WstringConverterPtr createUnicodeWstringConverter();
    template<typename charT>
    IceUtil::Handle<BasicStringConverter<charT>> createIconvStringConverter(const std::string& internalCode = "");
    StringConverterPtr createWindowsStringConverter(unsigned int codepage);

See Also