@@ -379,11 +379,11 @@ /* ** Write up to width characters of pLine into p->zLine[]. Translate tabs into ** spaces. Add a newline if SBS_NEWLINE is set. Translate HTML characters ** if SBS_HTML is set. Pad the rendering out width bytes if SBS_PAD is set. ** -** This comment contains multi-byte unicode characters (ü, Æ, ð) in order +** This comment contains multibyte unicode characters (ü, Æ, ð) in order ** to test the ability of the diff code to handle such characters. */ static void sbsWriteText(SbsLine *p, DLine *pLine, unsigned flags){ int n = pLine->h & LENGTH_MASK; int i; /* Number of input characters consumed */ @@ -430,10 +430,11 @@ }else if( c=='>' && p->escHtml ){ memcpy(&z[j], ">", 4); j += 4; }else{ z[j++] = c; + if( (c&0xc0)==0x80 ) k--; } } if( needEndSpan ){ memcpy(&z[j], "", 7); j += 7; @@ -885,11 +886,11 @@ int skip; /* Number of lines to skip */ int nChunk = 0; /* Number of chunks of diff output seen so far */ SbsLine s; /* Output line buffer */ memset(&s, 0, sizeof(s)); - s.zLine = fossil_malloc( 10*width + 200 ); + s.zLine = fossil_malloc( 15*width + 200 ); if( s.zLine==0 ) return; s.width = width; s.escHtml = escHtml; s.iStart = -1; s.iStart2 = 0;