Library: Foundation
Package: Text
Header: Poco/UTF16Encoding.h
UTF-16 text encoding, as defined in RFC 2781.
When converting from UTF-16 to Unicode, surrogates are reported as they are - in other words, surrogate pairs are not combined into one Unicode character. When converting from Unicode to UTF-16, however, characters outside the 16-bit range are converted into a low and high surrogate.
Direct Base Classes: TextEncoding
All Base Classes: TextEncoding
Member Functions: canonicalName, characterMap, convert, getByteOrder, isA, queryConvert, sequenceLength, setByteOrder
Inherited Functions: add, byName, canonicalName, characterMap, convert, find, global, isA, manager, queryConvert, remove, sequenceLength
UTF16Encoding(
    ByteOrderType byteOrder = NATIVE_BYTE_ORDER
);
Creates and initializes the encoding for the given byte order.
UTF16Encoding(
    int byteOrderMark
);
Creates and initializes the encoding for the byte-order indicated by the given byte-order mark, which is the Unicode character 0xFEFF.
 
 ~UTF16Encoding();
 
 const char * canonicalName() const;
See also: Poco::TextEncoding::canonicalName()
 
 const CharacterMap & characterMap() const;
See also: Poco::TextEncoding::characterMap()
 
 int convert(
    const unsigned char * bytes
) const;
See also: Poco::TextEncoding::convert()
 
 int convert(
    int ch,
    unsigned char * bytes,
    int length
) const;
See also: Poco::TextEncoding::convert()
ByteOrderType getByteOrder() const;
Returns the byte-order currently in use.
 
 bool isA(
    const std::string & encodingName
) const;
See also: Poco::TextEncoding::isA()
 
 int queryConvert(
    const unsigned char * bytes,
    int length
) const;
See also: Poco::TextEncoding::queryConvert()
 
 int sequenceLength(
    const unsigned char * bytes,
    int length
) const;
See also: Poco::TextEncoding::sequenceLength()
void setByteOrder(
    ByteOrderType byteOrder
);
Sets the byte order.
void setByteOrder(
    int byteOrderMark
);
Sets the byte order according to the given byte order mark, which is the Unicode character 0xFEFF.