Mercurial > projects > dwt-win
comparison dwt/dwthelper/utils.d @ 337:9041f892283b
Fix special case
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 19 Feb 2009 17:20:18 +0100 |
parents | f866e80af235 |
children |
comparison
equal
deleted
inserted
replaced
336:f866e80af235 | 337:9041f892283b |
---|---|
490 //alias tango.text.convert.Utf.toString toString; | 490 //alias tango.text.convert.Utf.toString toString; |
491 | 491 |
492 int toAbsoluteCodePointStartOffset( String str, int index ){ | 492 int toAbsoluteCodePointStartOffset( String str, int index ){ |
493 //Trace.formatln( "str={}, str.length={}, index={}", str, str.length, index ); | 493 //Trace.formatln( "str={}, str.length={}, index={}", str, str.length, index ); |
494 //Trace.memory( str ); | 494 //Trace.memory( str ); |
495 if( ( str[index] & 0x80 ) is 0x00 ) | 495 if( str.length is index ){ |
496 { | 496 return index; |
497 } | |
498 if( ( str[index] & 0x80 ) is 0x00 ) { | |
497 return index; | 499 return index; |
498 } | 500 } |
499 else{ | 501 else{ |
500 int steps = 0; | 502 int steps = 0; |
501 while(( str[index] & 0xC0 ) is 0x80 ){ | 503 while(( str[index] & 0xC0 ) is 0x80 ){ |