mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #1023 from RaiKoHoff/Dev_UCHARDET
Revert remapping of UCHARDET's GB18030 encoding predections - …
This commit is contained in:
commit
ebc2531eb9
@ -7973,15 +7973,14 @@ static void _SetFileVars(char* lpData, char* tch, LPFILEVARS lpfv)
|
||||
//
|
||||
// FileVars_Init()
|
||||
//
|
||||
|
||||
bool FileVars_Init(char *lpData, DWORD cbData, LPFILEVARS lpfv) {
|
||||
|
||||
char tch[LARGE_BUFFER];
|
||||
|
||||
ZeroMemory(lpfv,sizeof(FILEVARS));
|
||||
if ((Flags.NoFileVariables && Settings.NoEncodingTags) || !lpData || !cbData)
|
||||
if ((Flags.NoFileVariables && Settings.NoEncodingTags) || !lpData || !cbData) {
|
||||
return true;
|
||||
|
||||
}
|
||||
StringCchCopyNA(tch,COUNTOF(tch),lpData,min_s(cbData + 1,COUNTOF(tch)));
|
||||
_SetFileVars(lpData, tch, lpfv);
|
||||
|
||||
@ -7990,8 +7989,9 @@ bool FileVars_Init(char *lpData, DWORD cbData, LPFILEVARS lpfv) {
|
||||
_SetFileVars(lpData, tch, lpfv);
|
||||
}
|
||||
|
||||
if (lpfv->mask & FV_ENCODING)
|
||||
if (lpfv->mask & FV_ENCODING) {
|
||||
lpfv->iEncoding = Encoding_MatchA(lpfv->tchEncoding);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -722,6 +722,7 @@ extern "C" int Encoding_AnalyzeText
|
||||
float const ucd_confidence = ucd_cnf;
|
||||
float const ced_confidence = ced_cnf;
|
||||
|
||||
#if FALSE
|
||||
// --------------------------------------------------------------------------
|
||||
// GB18030 (UCD always) to GBK detection adjustment
|
||||
// --------------------------------------------------------------------------
|
||||
@ -741,7 +742,7 @@ extern "C" int Encoding_AnalyzeText
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// vote for encoding prognosis based on confidence levels or reliability
|
||||
|
||||
@ -164,7 +164,7 @@ typedef struct _filevars
|
||||
bool bTabIndents;
|
||||
bool fWordWrap;
|
||||
int iLongLinesLimit;
|
||||
char tchEncoding[32];
|
||||
char tchEncoding[64];
|
||||
int iEncoding;
|
||||
char tchMode[32];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user