diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 273d6db2a..7144a422d 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -212,50 +212,7 @@ void Editor::Finalise() { } void Editor::SetRepresentations() { - reprs.Clear(); - - // C0 control set - const char *const reps[] = { - "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", - "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", - "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", - "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" - }; - for (size_t j=0; j < std::size(reps); j++) { - const char c[2] = { static_cast<char>(j), 0 }; - reprs.SetRepresentation(std::string_view(c, 1), reps[j]); - } - reprs.SetRepresentation("\x7f", "DEL"); - - const int dbcsCodePage = pdoc->dbcsCodePage; - // C1 control set - // As well as Unicode mode, ISO-8859-1 should use these - if (CpUtf8 == dbcsCodePage) { - const char *const repsC1[] = { - "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA", - "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", - "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", - "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC" - }; - for (size_t j=0; j < std::size(repsC1); j++) { - const char c1[3] = { '\xc2', static_cast<char>(0x80+j), 0 }; - reprs.SetRepresentation(c1, repsC1[j]); - } - reprs.SetRepresentation("\xe2\x80\xa8", "LS"); - reprs.SetRepresentation("\xe2\x80\xa9", "PS"); - } - - // Invalid as single bytes in multi-byte encodings - if (dbcsCodePage) { - for (int k = 0x80; k < 0x100; k++) { - if ((CpUtf8 == dbcsCodePage) || !IsDBCSValidSingleByte(dbcsCodePage, k)) { - const char hiByte[2] = { static_cast<char>(k), 0 }; - char hexits[4]; - Hexits(hexits, k); - reprs.SetRepresentation(hiByte, hexits); - } - } - } + reprs.SetDefaultRepresentations(pdoc->dbcsCodePage); } void Editor::DropGraphics() noexcept { |