Skip to content
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

Use and honour xattr (extended attributes) text encoding #1824

Open
gingerbeardman opened this issue Mar 21, 2018 · 0 comments
Open

Use and honour xattr (extended attributes) text encoding #1824

gingerbeardman opened this issue Mar 21, 2018 · 0 comments

Comments

@gingerbeardman
Copy link

Proposal

Use xattr (extended attributes) on macOS to save/load text encoding with file.

BBEdit is the only editor I've found that already does this.

Also Chocolat should honours any keep any existing com.apple.TextEncoding value.

Background

  • Text Encoding has to either be set manually, or guessed by scanning the file
  • Both of these tasks take time

Benefits

  • loading time can be reduced
  • text encoding can be more persistent
  • can still be changed and rewritten at any point

Details

debug command:
xattr -p -l com.apple.TextEncoding "/path/to/file.txt"

output:
file.txt
com.apple.TextEncoding: Shift_JIS;2561

to set xattr (from terminal):
xattr -w com.apple.TextEncoding "Shift_JIS;2561" "/path/to/file.txt"

References

these may help with implementation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant