int x = start ;
for ( int i = 0 ; i < len-1 ; i++ )
{
int x2 = input.advance() ;
if ( x2 == -1 )
throw new AtlasException("Premature end to UTF-8 sequence at end of input") ;
if ( (x2 & 0xC0) != 0x80 )
//throw new AtlasException("Illegal UTF-8 processing character "+count+": "+x2) ;
throw new AtlasException(String.format("Illegal UTF-8 processing character: 0x%04X",x2)) ;
// 6 bits of x2
x = (x << 6) | (x2 & 0x3F);
}
return x ;
}