-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty file with non-Unicode encoding cannot be saved #10699
Comments
The problem exists with other encodings as well (e.g. Windows-1255). STR: Result: @donho, Thank you. |
Damned! How come I didn't see it coming. |
@Yaron10 @KiBERMiKE |
👍 |
The PR fixes the regression due to the saving file API being changecd from POSIX functions to Win32 native API: The old used function "fopen" using "wbc" as argument, according Microsoft document: "w" Opens an empty file for writing. If the given file exists, its contents are destroyed. (https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-160) so to save a 0 length document, it was unecessary to "write nothing" explicitely on disk, since fopen did it for you. Whereas our new implementation which uses Win32 native API passes "OPEN_ALWAYS" - that needs to "write nothing" explicitely. Fix #10699, close #10702
Notepad++ v8.1.8
If the opened file is encoded Windows-1251 and we delete all text and do "Save", then the changes are not saved
Steps to Reproduce the Issue
The text was updated successfully, but these errors were encountered: