dbcs_off2cells(unsigned off, unsigned max_off)
{
    // never check beyond end of the line
    if (off >= max_off)
	return 1;

    // Number of cells is equal to number of bytes, except for euc-jp when
    // the first byte is 0x8e.
    if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
	return 1;
    return MB_BYTE2LEN(ScreenLines[off]);
}
dbcs_off2cells(unsigned off, unsigned max_off)
{
     
    if (off >= max_off)
	return 1;

     
     
    if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
	return 1;
    return MB_BYTE2LEN(ScreenLines[off]);
}