[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 02:25 AM UTC
Owner: nobody
Attachments:
Using Scintilla 5.5.6/7 with DirectWrite enabled, autocompletion lists can display illegible text if both:
the host PC's ANSI code page is a DBCS encoding, and;
completion candidates are sourced from a document in the same DBCS encoding as the ACP.
It seems the popup list's character set remains in the singe-byte default setting (influenced by the document's ACP encoding 🤔?), rather than a character set appropriate for the active SC_TECHNOLOGY_*
setting.
Putting the parent Scintilla window into GDI mode resolves the issue.
Dynamically changing the popup's character set based on the document's encoding also appears to be effective.
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage /v ACP
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
ACP REG_SZ 936
with open('sample.txt', 'wb') as f:
f.write(bytes('zh-䏿–‡', '936'))
code.page=936
character.set=132
technology=1
autocompleteword.automatic=1
wscite.exe
and trigger the autocompletion list:Cross-posted from https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16719
Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
A possible fix is directly passing code page (instead of Unicode mode) to list box, but this maybe a broken change on platform interface.
ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(),
- lenEntered, lineHeight, IsUnicodeMode(), technology, options);
+ lenEntered, lineHeight, CodePage(), technology, options);
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 02:32 AM UTC
Owner: nobody
Attachments:
Or ListOptions
could be extended to add codePage
property like SurfaceMode
.
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 02:35 AM UTC
Owner: nobody
Attachments:
code.page=936
character.set=132
Code page 936 is GB 2312 but that doesn't match character set 132. GB2312_CHARSET
from WinGDI.h (and thus SC_CHARSET_GB2312
) is 134.
When the property is corrected to character.set=134
I see:
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 02:41 AM UTC
Owner: nobody
Attachments:
So, yes, the issue comes entirely from a misconfigured character set, not technology
after all. There must be a downstream reason why the char sets mismatch when N++ has D2D enabled.. Thanks anyway for looking at it.
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 03:10 AM UTC
Owner: nobody
Attachments:
May be worthwhile although the ordering (SetOptions
is called before Create
which has to be maintained for compatibility) should be considered in ListBoxX::Create
.
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 03:54 AM UTC
Owner: nobody
Attachments:
This patch to Scintilla fixes Notepad++ in some circumstances although I don't really understand how it is determining code pages and character sets so may not handle other cases. The patch is also OK in SciTE.
Attachments:
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Sun Jun 22, 2025 11:44 PM UTC
Owner: nobody
Attachments:
It works the same way as EditModel::CurrentSurfaceMode()
for Editor::CreateDrawingSurface()
, code page 0 is CP_ACP.
unicodeMode
filed and parameter can be removed.
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Tue Jun 24, 2025 12:52 AM UTC
Owner: nobody
Attachments:
A SurfaceMode
could be added to ListOptions
but that would imply that bidiR2L
may be implemented which looks unlikely due to lack of interest in bidirectional work. SurfaceMode
may grow more complex.
If CodePageTransfer.patch
is committed, there are various pieces of dead code that could be trimmed (FontWin::GetCharacterSet
...) .
[bugs:#2483] (Win32) Sourcing autocompletion candidates from DBCS files has regressed since 5.5.6
Status: open
Group: Bug
Labels: Scintilla win32 autocomplete DBCS directwrite
Created: Sun Jun 22, 2025 02:25 AM UTC by rdipardo
Last Updated: Tue Jun 24, 2025 10:37 AM UTC
Owner: nobody
Attachments: