if (OS.IsUnicode) return wcsPos;
int wcsToMbcsPos (int wcsPos) {	if (wcsPos <= 0) return 0;	if (OS.IsUnicode) return wcsPos;	int cp = getCodePage ();	int wcsTotal = 0, mbcsTotal = 0;	byte [] buffer = new byte [128];	String delimiter = getLineDelimiter ();	int delimiterSize = delimiter.length ();	int count = OS.SendMessageA (handle, OS.EM_GETLINECOUNT, 0, 0);	for (int line=0; line<count; line++) {		int wcsSize = 0;		int linePos = OS.SendMessageA (handle, OS.EM_LINEINDEX, line, 0);		int mbcsSize = OS.SendMessageA (handle, OS.EM_LINELENGTH, linePos, 0);		if (mbcsSize != 0) {			if (mbcsSize + delimiterSize > buffer.length) {				buffer = new byte [mbcsSize + delimiterSize];			}			//ENDIAN			buffer [0] = (byte) (mbcsSize & 0xFF);			buffer [1] = (byte) (mbcsSize >> 8);			mbcsSize = OS.SendMessageA (handle, OS.EM_GETLINE, line, buffer);			wcsSize = OS.MultiByteToWideChar (cp, OS.MB_PRECOMPOSED, buffer, mbcsSize, null, 0);		}		if (line - 1 != count) {			for (int i=0; i<delimiterSize; i++) {				buffer [mbcsSize++] = (byte) delimiter.charAt (i);			}			wcsSize += delimiterSize;		}		if ((wcsTotal + wcsSize) >= wcsPos) {			wcsSize = 0;			int index = 0;			while (index < mbcsSize) {				if ((wcsTotal + wcsSize) == wcsPos) {					return mbcsTotal + index;				}				if (OS.IsDBCSLeadByte (buffer [index++])) index++;				wcsSize++;			}			return mbcsTotal + mbcsSize;		}		wcsTotal += wcsSize;		mbcsTotal += mbcsSize;	}	return mbcsTotal;}