Skip to content

Commit

Permalink
reverting, and fixing encoding / code-page issues:
Browse files Browse the repository at this point in the history
- consistent encoding <> code-page handling (including Scintilla's code-page settings)
- Scintilla issue regarding notepad2-mod issie rizonesoft#173 (see XhmikosR/notepad2-mod#193)
- allow arbitrary conversion between encodings (even it it does not make sense in any case)
  (instead of doing silently nothing but changing encoding info on status bar)
  • Loading branch information
RaiKoHoff committed Aug 5, 2017
1 parent 7647e03 commit da07368
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 156 deletions.
3 changes: 2 additions & 1 deletion scintilla/doc/ScintillaDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,8 @@ <h2 id="StyleDefinition">Style definition</h2>
number used by the C and C++ lexer to display literal strings; it has the value 6). This
feature works differently on Windows and GTK+.<br />
The default character set is <code>SC_CHARSET_DEFAULT</code>.</p>
<p><code>SC_CHARSET_ANSI</code> and <code>SC_CHARSET_DEFAULT</code> specify European Windows code page 1252 unless the code page is set.</p>
<p><code>SC_CHARSET_ANSI</code> specifies European Windows code page 1252.</p>
<p><code>SC_CHARSET_DEFAULT</code> specifies the system-default code page unless the code page is set.</p>

<table class="standard" summary="Character Sets supported"><tbody>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions scintilla/doc/ScintillaHistory.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down Expand Up @@ -1028,7 +1028,7 @@ <h3>
C++11 range-based for loops used in SciTE so GCC 4.6 is now the minimum supported version.
</li>
<li>
SC_CHARSET_DEFAULT now means code page 1252 on Windows unless a code page is set.
(REVERTED in Notepad2-mod) SC_CHARSET_DEFAULT now means code page 1252 on Windows unless a code page is set.
This prevents unexpected behaviour and crashes on East Asian systems where default locales are commonly DBCS.
Projects which want to default to DBCS code pages in East Asian locales should set the code page and
character set explicitly.
Expand Down
3 changes: 2 additions & 1 deletion scintilla/win32/ScintillaWin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,8 @@ UINT CodePageFromCharSet(DWORD characterSet, UINT documentCodePage) {
}
switch (characterSet) {
case SC_CHARSET_ANSI: return 1252;
case SC_CHARSET_DEFAULT: return documentCodePage ? documentCodePage : 1252;
//case SC_CHARSET_DEFAULT: return documentCodePage ? documentCodePage : 1252; // SCI orig
case SC_CHARSET_DEFAULT: return documentCodePage;
case SC_CHARSET_BALTIC: return 1257;
case SC_CHARSET_CHINESEBIG5: return 950;
case SC_CHARSET_EASTEUROPE: return 1250;
Expand Down
Loading

0 comments on commit da07368

Please sign in to comment.