diff options
author | nyamatongwe <unknown> | 2010-03-27 22:55:20 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-03-27 22:55:20 +0000 |
commit | 69cc75177ff14bedf43b3c3ccb2e31a5fe3d8921 (patch) | |
tree | ffdbdd447fa4988135691c5790d0b1e40a8cb0ac | |
parent | 809e868a292e6c813c115bb0178e9f6fdde148a0 (diff) | |
download | scintilla-mirror-69cc75177ff14bedf43b3c3ccb2e31a5fe3d8921.tar.gz |
Display bad Unicode bytes with a leading 'x' so form feed is distinguished
from \xff.
-rw-r--r-- | doc/ScintillaHistory.html | 7 | ||||
-rw-r--r-- | src/Editor.cxx | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 402b295fa..f94b28b54 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -378,6 +378,13 @@ Multiple paste option. </li> <li> + Detects more forms of bad UTF-8 including overlong sequences, surrogates, and characters outside + the valid range. + </li> + <li> + SCI_GETTAG retrieves the value of captured expressions within regular expression searches. + </li> + <li> Rectangular selection expansion <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2948260&group_id=2439">Bug #2948260.</a> </li> diff --git a/src/Editor.cxx b/src/Editor.cxx index 03b06af23..c313e3928 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2060,8 +2060,8 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou } lastSegItalics = false; } else if (isBadUTF) { - char hexits[3]; - sprintf(hexits, "%2X", ll->chars[charInLine] & 0xff); + char hexits[4]; + sprintf(hexits, "x%2X", ll->chars[charInLine] & 0xff); ll->positions[charInLine + 1] = surface->WidthText(ctrlCharsFont, hexits, istrlen(hexits)) + 3; } else { // Regular character @@ -2829,8 +2829,9 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis cc, 1, textBack, textFore); } } else if ((i == startseg) && (static_cast<unsigned char>(ll->chars[i]) >= 0x80) && IsUnicodeMode()) { - char hexits[3]; - sprintf(hexits, "%2X", ll->chars[i] & 0xff); + // A single byte >= 0x80 in UTF-8 is a bad byte and is displayed as its hex value + char hexits[4]; + sprintf(hexits, "x%2X", ll->chars[i] & 0xff); DrawTextBlob(surface, vsDraw, rcSegment, hexits, textBack, textFore, twoPhaseDraw); } else { // Normal text display |