Skip to content

Commit

Permalink
Fix encoding detection bug when reload file with UTF-8 BOM, issue #686.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jul 22, 2023
1 parent 8e1f3b7 commit e632ff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EditEncoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ int EditDetermineEncoding(LPCWSTR pszFile, char *lpData, DWORD cbData, int *enco
} else if (!Encoding_IsUnicode(iDefaultEncoding)) {
iEncoding = iDefaultEncoding;
}
return iEncoding;
return (iEncoding == CPI_UTF8SIGN) ? CPI_UTF8 : iEncoding;
}

// reload with specific encoding
Expand Down

0 comments on commit e632ff2

Please sign in to comment.