diff options
Diffstat (limited to 'lexlib')
| -rw-r--r-- | lexlib/LexAccessor.h | 20 | 
1 files changed, 18 insertions, 2 deletions
| diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index c38392e88..6458525cc 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -25,6 +25,7 @@ private:  	int startPos;  	int endPos;  	int codePage; +	enum { enc8bit, encUnicode, encDBCS } encodingType;  	int lenDoc;  	int mask;  	char styleBuf[bufferSize]; @@ -33,6 +34,7 @@ private:  	char chWhile;  	unsigned int startSeg;  	int startPosStyling; +	int documentVersion;  	void Fill(int position) {  		startPos = position - slopSize; @@ -51,9 +53,23 @@ private:  public:  	LexAccessor(IDocument *pAccess_) :  		pAccess(pAccess_), startPos(extremePosition), endPos(0), -		codePage(pAccess->CodePage()), lenDoc(pAccess->Length()), +		codePage(pAccess->CodePage()),  +		encodingType(enc8bit), +		lenDoc(pAccess->Length()),  		mask(127), validLen(0), chFlags(0), chWhile(0), -		startSeg(0), startPosStyling(0) { +		startSeg(0), startPosStyling(0),  +		documentVersion(pAccess->Version()) { +		switch (codePage) { +		case 65001: +			encodingType = encUnicode; +			break; +		case 932: +		case 936: +		case 949: +		case 950: +		case 1361: +			encodingType = encDBCS; +		}  	}  	char operator[](int position) {  		if (position < startPos || position >= endPos) { | 
