From 521ef7054806424c97dac5ee71b3a05ed5b9d7f4 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Mon, 21 May 2018 15:15:34 +1000 Subject: Draw invalid bytes in DBCS when detected as blobs in a similar way to UTF-8. --- src/PositionCache.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/PositionCache.cxx') diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index bf5560678..31a8601f5 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -508,7 +508,8 @@ TextSegment BreakFinder::Next() { charWidth = UTF8DrawBytes(reinterpret_cast(&ll->chars[nextBreak]), static_cast(lineRange.end - nextBreak)); else if (encodingFamily == efDBCS) - charWidth = pdoc->IsDBCSLeadByteNoExcept(ll->chars[nextBreak]) ? 2 : 1; + charWidth = pdoc->DBCSDrawBytes( + std::string_view(&ll->chars[nextBreak], lineRange.end - nextBreak)); const Representation *repr = preprs->RepresentationFromCharacter(&ll->chars[nextBreak], charWidth); if (((nextBreak > 0) && (ll->styles[nextBreak] != ll->styles[nextBreak - 1])) || repr || -- cgit v1.2.3