diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2018-05-21 15:15:34 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2018-05-21 15:15:34 +1000 |
commit | 521ef7054806424c97dac5ee71b3a05ed5b9d7f4 (patch) | |
tree | d46c95588195f593baa1c46b0882e1c169b6b590 /src/Editor.cxx | |
parent | 150417216d362bae78621939102f8183af951f78 (diff) | |
download | scintilla-mirror-521ef7054806424c97dac5ee71b3a05ed5b9d7f4.tar.gz |
Draw invalid bytes in DBCS when detected as blobs in a similar way to UTF-8.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9aba5ccd2..04d61bea6 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -242,6 +242,17 @@ void Editor::SetRepresentations() { sprintf(hexits, "x%2X", k); reprs.SetRepresentation(hiByte, hexits); } + } else if (pdoc->dbcsCodePage) { + // DBCS invalid single lead bytes + for (int k = 0x80; k < 0x100; k++) { + char ch = static_cast<char>(k); + if (pdoc->IsDBCSLeadByteNoExcept(ch) || pdoc->IsDBCSLeadByteInvalid(ch)) { + const char hiByte[2] = { ch, 0 }; + char hexits[5]; // Really only needs 4 but that causes warning from gcc 7.1 + sprintf(hexits, "x%2X", k); + reprs.SetRepresentation(hiByte, hexits); + } + } } } |