mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Save xattr encoding to empty file
This commit is contained in:
parent
4d5151f359
commit
ab0bea814a
@ -12,6 +12,7 @@ develop
|
||||
- Move scripts folder location from `~/Library/Application Support/CotEditor/ScriptMenu/` to `~/Library/Application Scripts/com.coteditor.CotEditor/` because of the Sandbox requirement.
|
||||
- Users need to migrate their script to the new folder manually, since CotEditor doesn't have the write permisson to the new location.
|
||||
- Set access-group `com.coteditor.CotEditor.edit` to CotEditor's script definition.
|
||||
- Change behavior to save `com.apple.TextEncoding` xattr on saving if the file had no content.
|
||||
|
||||
|
||||
|
||||
|
@ -195,7 +195,7 @@ NSString *const CEIncompatibleConvertedCharKey = @"convertedChar";
|
||||
NSStringEncoding xattrEncoding = [self fileURL] ? [[self fileURL] getAppleTextEncoding] : NSNotFound;
|
||||
|
||||
// don't save xattr if file doesn't have it in order to avoid saving wrong encoding (2015-01 by 1024jp).
|
||||
[self setShouldSaveXattr:(xattrEncoding != NSNotFound)];
|
||||
[self setShouldSaveXattr:(xattrEncoding != NSNotFound) || ([data length] == 0)];
|
||||
|
||||
return [self readStringFromData:data encoding:[self readingEncoding] xattrEncoding:xattrEncoding];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user