48 virtual void setBuffer(
const char* buf,
int length )
51 bufferLength_ = length;
55 virtual const char*
buffer()
const {
return bufferRef_; }
90 static bool hasUTF8Bom(
const char* buffer,
int length );
100 const char* bufferRef_;
virtual void setBuffer(const char *buf, int length)
Sets the buffer reference.
Definition: textcodecdetector.h:48
virtual void setFallbackCodec(TextCodec *codec=0)
Sets the fallback text codec.
Definition: textcodecdetector.cpp:83
virtual void setPreferedCodec(TextCodec *codec=0)
This method returns the prefered codec.
Definition: textcodecdetector.cpp:69
static bool hasUTF16BEBom(const char *buffer, int length)
Has a Byte Order Marker for UTF-16 Big Endian (utf-16 and ucs-2).
Definition: textcodecdetector.cpp:251
virtual bool isFourBytesSequence(char b)
If the byte has the form 11110xx, then it's the first byte of a four-bytes sequence character...
Definition: textcodecdetector.h:81
virtual bool isContinuationChar(char b)
If the byte has the form 10xxxxx, then it's a continuation byte of a multiple byte character;...
Definition: textcodecdetector.h:72
virtual bool isThreeBytesSequence(char b)
If the byte has the form 1110xxx, then it's the first byte of a three-bytes sequence character...
Definition: textcodecdetector.h:78
virtual bool isFiveBytesSequence(char b)
If the byte has the form 11110xx, then it's the first byte of a five-bytes sequence character...
Definition: textcodecdetector.h:84
static bool hasUTF32BEBom(const char *buffer, int length)
Has a Byte Order Marker for UTF-32 Big Endian.
Definition: textcodecdetector.cpp:267
TextCodecDetector(const QByteArray *buffer=0, TextCodec *preferedCodec=0)
Definition: textcodecdetector.cpp:43
virtual TextCodec * detectCodec()
Detects the encoding of the provided buffer. If Byte Order Markers are encountered at the beginning o...
Definition: textcodecdetector.cpp:122
This class represents a single text codec The codec has a name and contains methods to create encoder...
Definition: textcodec.h:37
This class is used to detect the encoding of a given string. The detector is based on the Java code o...
Definition: textcodecdetector.h:31
virtual ~TextCodecDetector()
Definition: textcodecdetector.cpp:63
virtual const char * buffer() const
Returns the buffer reference.
Definition: textcodecdetector.h:55
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
virtual int bufferLength()
Returns the buffer length.
Definition: textcodecdetector.h:58
static bool hasUTF16LEBom(const char *buffer, int length)
Has a Byte Order Marker for UTF-16 Low Endian (ucs-2le, ucs-4le, and ucs-16le).
Definition: textcodecdetector.cpp:243
static bool hasUTF8Bom(const char *buffer, int length)
Has a Byte Order Marker for UTF-8.
Definition: textcodecdetector.cpp:235
virtual bool isSixBytesSequence(char b)
Definition: textcodecdetector.h:87
virtual TextCodec * fallbackCodec() const
Definition: textcodecdetector.h:65
virtual TextCodec * preferedCodec()
Definition: textcodecdetector.h:61
static bool hasUTF32LEBom(const char *buffer, int length)
Has a Byte Order Marker for UTF-32 Low Endian.
Definition: textcodecdetector.cpp:260
virtual bool isTwoBytesSequence(char b)
If the byte has the form 110xxxx, then it's the first byte of a two-bytes sequence character...
Definition: textcodecdetector.h:75
static void setGlobalPreferedCodec(TextCodec *codec)
Definition: textcodecdetector.cpp:36
static TextCodec * globalPreferedCodec()
return the static global prefered codec
Definition: textcodecdetector.cpp:27