Poco

class UTF16Encoding

Library: Foundation
Package: Text
Header: Poco/UTF16Encoding.h

Description

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.

Inheritance

Direct Base Classes: TextEncoding

All Base Classes: TextEncoding

Member Summary

Member Functions: characterMap, convert, getByteOrder, setByteOrder

Inherited Functions: characterMap, convert

Enumerations

ByteOrderType

BIG_ENDIAN_BYTE_ORDER

LITTLE_ENDIAN_BYTE_ORDER

NATIVE_BYTE_ORDER

Constructors

UTF16Encoding

UTF16Encoding(
    ByteOrderType byteOrder = NATIVE_BYTE_ORDER
);

Creates and initializes the encoding for the given byte order.

UTF16Encoding

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.

Destructor

~UTF16Encoding virtual

~UTF16Encoding();

Member Functions

characterMap virtual

const CharacterMap & characterMap() const;

See also: Poco::TextEncoding::characterMap()

convert virtual

int convert(
    const unsigned char * bytes
) const;

See also: Poco::TextEncoding::convert()

convert virtual

int convert(
    int ch,
    unsigned char * bytes,
    int length
) const;

See also: Poco::TextEncoding::convert()

getByteOrder

ByteOrderType getByteOrder() const;

Returns the byte-order currently in use.

setByteOrder

void setByteOrder(
    ByteOrderType byteOrder
);

Sets the byte order.

setByteOrder

void setByteOrder(
    int byteOrderMark
);

Sets the byte order according to the given byte order mark, which is the Unicode character 0xFEFF.