#include <archon/util/charenc.H>
Collaboration diagram for Archon::Utilities::CharEnc:
Public Member Functions | |
CharEnc (string sourceEncoding, string targetEncoding) | |
Construct an object that can be used for incremental transcoding. | |
~CharEnc () | |
void | transcode (const char *&sourceBuffer, size_t &sourceBytesLeft, char *&targetBuffer, size_t &targetBytesLeft, bool fail=false) throw (TranscodeException) |
Static Public Member Functions | |
static string | encode (wstring s, string encoding=UTF_8, bool fail=false) throw (TranscodeException) |
static wstring | decode (string s, string encoding=UTF_8, bool fail=false) throw (TranscodeException) |
Illegal input charcters will be converted to the Unicode replacement character. | |
static string | transcode (string s, string sourceEncoding, string targetEncoding, bool fail=false) throw (TranscodeException) |
Illegal charcters in the input will be converted to the Unicode replacement character or another suitable replacement character available in the target encoding. | |
Static Public Attributes | |
static const string | US_ASCII = "US-ASCII" |
Classical American 7-bit encoding. | |
static const string | ISO_8859_1 = "ISO-8859-1" |
ISO Latin 1 encoding. | |
static const string | ISO_8859_15 = "ISO-8859-15" |
ISO Latin 1 encoding with Euro sign. | |
static const string | UTF_8 = "UTF-8" |
ISO 8-bit variable length Unicode (UCS) encoding. | |
static const string | UTF_16LE = "UTF-16LE" |
ISO 16-bit little-endian variable length Unicode (UCS) encoding. | |
static const string | UTF_16BE = "UTF-16BE" |
ISO 16-bit big-endian variable length Unicode (UCS) encoding. | |
static const string | UTF_32LE = "UTF-32LE" |
ISO 32-bit little-endian fixed length Unicode (UCS) encoding. | |
static const string | UTF_32BE = "UTF-32BE" |
ISO 32-bit big-endian fixed length Unicode (UCS) encoding. | |
static const string | WINDOWS_1252 = "WINDOWS-1252" |
MS Windows expansion of US-ASCII which is incompatible with ISO Latin 1. | |
Classes | |
struct | TranscodeException |
Definition at line 37 of file charenc.H.
|
Construct an object that can be used for incremental transcoding. Such a thing would be needed when transcoding a stream since here the complete data set is never available.
Definition at line 128 of file charenc.C. References Archon::Utilities::Text::toString(). |
|
Illegal input charcters will be converted to the Unicode replacement character.
Definition at line 84 of file charenc.C. References transcode(). |
|
|
|
Definition at line 167 of file charenc.C. References n, and transcode(). |
|
Illegal charcters in the input will be converted to the Unicode replacement character or another suitable replacement character available in the target encoding.
Definition at line 106 of file charenc.C. References transcode(). Referenced by decode(), Archon::Utilities::FormatLibjpeg::load(), Archon::Utilities::FormatLibpng::save(), Archon::Utilities::FormatLibjpeg::save(), and transcode(). |