changeset 337:9041f892283b

Fix special case
author Frank Benoit <benoit@tionex.de>
date Thu, 19 Feb 2009 17:20:18 +0100
parents f866e80af235
children ecb375fd8f95
files dwt/dwthelper/utils.d
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d	Wed Feb 18 19:26:35 2009 +0100
+++ b/dwt/dwthelper/utils.d	Thu Feb 19 17:20:18 2009 +0100
@@ -492,8 +492,10 @@
 int toAbsoluteCodePointStartOffset( String str, int index ){
     //Trace.formatln( "str={}, str.length={}, index={}", str, str.length, index );
     //Trace.memory( str );
-    if( ( str[index] & 0x80 ) is 0x00 )
-    {
+    if( str.length is index ){
+        return index;
+    }
+    if( ( str[index] & 0x80 ) is 0x00 ) {
         return index;
     }
     else{