|| (temp >= 0xdc00)) {
|| (temp > 0xdfff)) {
	private int getChar() throws NavException {		int temp = 0;		int a, c, d;		int val;		int ch;		a = c = d = val = 0;		switch (encoding) {			case FORMAT_ASCII : // ascii is compatible with UTF-8, the offset value is bytes				temp = XMLDoc.byteAt(currentOffset);				if (temp == '\r') {					if (XMLDoc.byteAt(currentOffset + 1) == '\n') {						currentOffset += 2;						return '\n';					} else {						currentOffset++;						return '\n';					}				}				currentOffset++;				return temp;			case FORMAT_UTF8 :				temp = XMLDoc.byteAt(currentOffset) & 0xff;				switch (UTF8Char.byteCount(temp)) {					case 1 :						if (temp == '\r') {							if (XMLDoc.byteAt(currentOffset + 1) == '\n') {								currentOffset += 2;								return '\n';							} else {								currentOffset++;								return '\n';							}						}						currentOffset++;						return temp;					case 2 :						c = 0x1f;						d = 6;						a = 1;						break;					case 3 :						c = 0x0f;						d = 12;						a = 2;						break;					case 4 :						c = 0x07;						d = 18;						a = 3;						break;					case 5 :						c = 0x03;						d = 24;						a = 4;						break;					case 6 :						c = 0x01;						d = 30;						a = 5;						break;					default :						throw new NavException("UTF 8 encoding error: should never happen");				}				val = (temp & c) << d;				int i = a - 1;				while (i >= 0) {					temp = XMLDoc.byteAt(currentOffset + a - i);					if ((temp & 0xc0) != 0x80)						throw new NavException("UTF 8 encoding error: should never happen");					val = val | ((temp & 0x3f) << ((i<<2)+(i<<1)));					i--;				}				currentOffset += a + 1;				return val;			case FORMAT_ISO_8859 :				temp = XMLDoc.byteAt(currentOffset);				if (temp == '\r') {					if (XMLDoc.byteAt(currentOffset + 1) == '\n') {						currentOffset += 2;						return '\n';					} else {						currentOffset++;						return '\n';					}				}				currentOffset++;				return temp & 0xff;			case FORMAT_UTF_16BE :				// implement UTF-16BE to UCS4 conversion				temp =					(XMLDoc.byteAt(currentOffset << 1)						<< 8) | XMLDoc.byteAt((currentOffset << 1) + 1);				if ((temp < 0xd800)					|| (temp >= 0xdc00)) { // not a high surrogate					if (temp == '\r') {						if (XMLDoc.byteAt((currentOffset << 1) + 3) == '\n'							&& XMLDoc.byteAt((currentOffset << 1) + 2) == 0) {							currentOffset += 2;							return '\n';						} else {							currentOffset++;							return '\n';						}					}					currentOffset++;					return temp;				} else {					val = temp;					temp =						(XMLDoc.byteAt((currentOffset << 1) + 2)							<< 8) | XMLDoc.byteAt((currentOffset << 1 )+ 3);					if (temp < 0xdc00 || temp > 0xdfff) {						// has to be a low surrogate here						throw new NavException("UTF 16 BE encoding error: should never happen");					}					val = ((val - 0xd800) << 10) + (temp - 0xdc00) + 0x10000;					currentOffset += 2;					return val;				}			case FORMAT_UTF_16LE :				// implement UTF-16LE to UCS4 conversion				temp =					XMLDoc.byteAt((currentOffset << 1) + 1)						<< 8 | XMLDoc.byteAt(currentOffset << 1);				if (temp < 0xdc00 || temp > 0xdfff) { // check for low surrogate					if (temp == '\r') {						if (XMLDoc.byteAt((currentOffset << 1) + 2) == '\n'							&& XMLDoc.byteAt((currentOffset << 1) + 3) == 0) {							currentOffset += 2;							return '\n';						} else {							currentOffset++;							return '\n';						}					}					currentOffset++;					return temp;				} else {					val = temp;					temp =						XMLDoc.byteAt((currentOffset << 1) + 3)							<< 8 | XMLDoc.byteAt((currentOffset << 1) + 2);					if (temp < 0xd800 || temp > 0xdc00) {						// has to be high surrogate						throw new NavException("UTF 16 LE encoding error: should never happen");					}					val = ((temp - 0xd800)<<10) + (val - 0xdc00) + 0x10000;					currentOffset += 2;					return val;				}				//System.out.println("UTF 16 LE unimplemented for now");			default :				throw new NavException("Unknown Encoding");		}	}