class UTF8Encoding

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


UTF-8 text encoding, as defined in RFC 2279.


Direct Base Classes: TextEncoding

All Base Classes: TextEncoding

Member Summary

Member Functions: canonicalName, characterMap, convert, isA, isLegal, queryConvert, sequenceLength

Inherited Functions: add, byName, canonicalName, characterMap, convert, find, global, isA, manager, queryConvert, remove, sequenceLength





~UTF8Encoding virtual


Member Functions

canonicalName virtual

const char * canonicalName() const;

See also: Poco::TextEncoding::canonicalName()

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()

isA virtual

bool isA(
    const std::string & encodingName
) const;

See also: Poco::TextEncoding::isA()

isLegal static

static bool isLegal(
    const unsigned char * bytes,
    int length

Utility routine to tell whether a sequence of bytes is legal UTF-8. This must be called with the length pre-determined by the first byte. The sequence is illegal right away if there aren't enough bytes available. If presented with a length > 4, this function returns false. The Unicode definition of UTF-8 goes up to 4-byte sequences.

Adapted from ftp://ftp.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c Copyright 2001-2004 Unicode, Inc.

queryConvert virtual

int queryConvert(
    const unsigned char * bytes,
    int length
) const;

See also: Poco::TextEncoding::queryConvert()

sequenceLength virtual

int sequenceLength(
    const unsigned char * bytes,
    int length
) const;

See also: Poco::TextEncoding::sequenceLength()