Skip to content

Commit

Permalink
Bring back the LoadASCIIasUTF8 preference (part 1), issue #196.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed May 16, 2020
1 parent d4a18c3 commit 8ec8e1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Edit.c
Expand Up @@ -59,6 +59,7 @@ extern BOOL bAutoStripBlanks;
extern int iDefaultCodePage;
//extern int iDefaultCharSet;
extern BOOL bLoadANSIasUTF8;
extern BOOL bLoadASCIIasUTF8;
extern BOOL bLoadNFOasOEM;
extern int iSrcEncoding;
extern int iWeakSrcEncoding;
Expand Down Expand Up @@ -951,7 +952,7 @@ BOOL EditSaveFile(HWND hwnd, LPCWSTR pszFile, BOOL bSaveCopy, EditFileIOStatus *
int iEncoding = status->iEncoding;
UINT uFlags = mEncoding[iEncoding].uFlags;
if (cbData >= MAX_NON_UTF8_SIZE) {
// save in UTF-8 or ANSI
// save as UTF-8 or ANSI
if (!(uFlags & (NCP_DEFAULT | NCP_UTF8))) {
if (uFlags & NCP_UNICODE_BOM) {
iEncoding = CPI_UTF8SIGN;
Expand Down
3 changes: 3 additions & 0 deletions src/Notepad2.c
Expand Up @@ -153,6 +153,7 @@ static BOOL bViewEOLs;
int iDefaultEncoding;
BOOL bSkipUnicodeDetection;
BOOL bLoadANSIasUTF8;
BOOL bLoadASCIIasUTF8;
BOOL bLoadNFOasOEM;
BOOL bNoEncodingTags;
int iSrcEncoding = -1;
Expand Down Expand Up @@ -5375,6 +5376,7 @@ void LoadSettings(void) {

bSkipUnicodeDetection = IniSectionGetBool(pIniSection, L"SkipUnicodeDetection", 1);
bLoadANSIasUTF8 = IniSectionGetBool(pIniSection, L"LoadANSIasUTF8", 0);
bLoadASCIIasUTF8 = IniSectionGetBool(pIniSection, L"LoadASCIIasUTF8", 1);
bLoadNFOasOEM = IniSectionGetBool(pIniSection, L"LoadNFOasOEM", 1);
bNoEncodingTags = IniSectionGetBool(pIniSection, L"NoEncodingTags", 0);

Expand Down Expand Up @@ -5694,6 +5696,7 @@ void SaveSettings(BOOL bSaveSettingsNow) {
IniSectionSetIntEx(pIniSection, L"DefaultEncoding", Encoding_MapIniSetting(FALSE, iDefaultEncoding), Encoding_MapIniSetting(FALSE, CPI_UTF8));
IniSectionSetBoolEx(pIniSection, L"SkipUnicodeDetection", bSkipUnicodeDetection, 1);
IniSectionSetBoolEx(pIniSection, L"LoadANSIasUTF8", bLoadANSIasUTF8, 0);
IniSectionSetBoolEx(pIniSection, L"LoadASCIIasUTF8", bLoadASCIIasUTF8, 1);
IniSectionSetBoolEx(pIniSection, L"LoadNFOasOEM", bLoadNFOasOEM, 1);
IniSectionSetBoolEx(pIniSection, L"NoEncodingTags", bNoEncodingTags, 0);
IniSectionSetIntEx(pIniSection, L"DefaultEOLMode", iDefaultEOLMode, 0);
Expand Down

0 comments on commit 8ec8e1e

Please sign in to comment.