From b68733559771e8b8b5d322de54ea4c3bb1c37758 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 10 Apr 2020 09:32:30 +1000 Subject: =?UTF-8?q?Backport:=20Bug=20[#2168].=20Fix=20bug=20where=20'?= =?UTF-8?q?=C2=B5'=20(Micro=20Sign)=20case-insensitively=20matches=20'=3F'?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of changeset 8134:b28166a7c77b. --- doc/ScintillaHistory.html | 8 ++++++++ qt/ScintillaEditBase/ScintillaQt.cpp | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 28378b6e2..24e0b4173 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -604,6 +604,14 @@ Bug #2167.
  • + On Qt with default encoding (ISO 8859-1) fix bug where 'ยต' (Micro Sign) case-insensitively matches '?' + Bug #2168. +
  • +
  • + On GTK with Wayland fix display of windowed IME. + Bug #2149. +
  • +
  • Don't clear clipboard before copying text with Qt. Bug #2147.
  • diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index 4236c7f86..3c62ec7fd 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -575,9 +575,11 @@ CaseFolder *ScintillaQt::CaseFolderForEncoding() sCharacter[0] = i; QString su = codec->toUnicode(sCharacter, 1); QString suFolded = su.toCaseFolded(); - QByteArray bytesFolded = codec->fromUnicode(suFolded); - if (bytesFolded.length() == 1) { - pcf->SetTranslation(sCharacter[0], bytesFolded[0]); + if (codec->canEncode(suFolded)) { + QByteArray bytesFolded = codec->fromUnicode(suFolded); + if (bytesFolded.length() == 1) { + pcf->SetTranslation(sCharacter[0], bytesFolded[0]); + } } } return pcf; -- cgit v1.2.3