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 xattr (extended attributes) on macOS to save/load text encoding identifier with file #46271

Closed
gingerbeardman opened this issue Mar 21, 2018 · 9 comments
Labels
feature-request Request for new features or functionality file-encoding File encoding type issues *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@gingerbeardman
Copy link

gingerbeardman commented Mar 21, 2018

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 VSCode should honour any existing com.apple.TextEncoding and keep it when saving.

Currently the value is ignored and the encoding is guessed, often incorrectly, by looking at the contents of the file. Thankfully the xattr is kept when saving the file.

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:

  • VSCode Version: 1.21.1
  • OS Version: 10.13.3
@gingerbeardman gingerbeardman changed the title Use xattr (extended attributes) on macOS to save/load text encoding with file Use xattr (extended attributes) on macOS to save/load text encoding identifier with file Mar 21, 2018
@Tyriar Tyriar added the file-encoding File encoding type issues label Mar 22, 2018
@alexdima alexdima assigned bpasero and unassigned alexdima Mar 28, 2018
@bpasero bpasero added the feature-request Request for new features or functionality label Mar 28, 2018
@bpasero bpasero removed their assignment Mar 28, 2018
@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Sep 11, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 11, 2018

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Sep 11, 2018
@gingerbeardman
Copy link
Author

gingerbeardman commented Sep 11, 2018

what a waste of time @bpasero

@bpasero
Copy link
Member

bpasero commented Sep 11, 2018

I am reopening this, it is a well written feature request with lots of description and insights. Sorry for closing it in the first place.

@bpasero bpasero reopened this Sep 11, 2018
@bpasero bpasero removed the *out-of-scope Posted issue is not in scope of VS Code label Sep 11, 2018
@gingerbeardman
Copy link
Author

Thank you @bpasero — have a great day

@bpasero bpasero added file-guess-encoding and removed file-encoding File encoding type issues labels Oct 14, 2019
@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@bpasero bpasero added file-encoding File encoding type issues and removed file-guess-encoding labels Sep 16, 2021
@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Dec 6, 2022
@vscodenpa
Copy link

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
@gingerbeardman
Copy link
Author

gingerbeardman commented Dec 6, 2022

Strong disagree.

4.5 years.

Multiple close and reopen.

What a farce.

@bpasero
Copy link
Member

bpasero commented Dec 6, 2022

Please see #167999 for our plan this month to clean up and "groom" all opened issues. This issue was closed as part of that initiative.

@0xced
Copy link

0xced commented Apr 19, 2024

Here are more references in case someone decides it would actually be a good idea to implement (it is!).

@gingerbeardman
Copy link
Author

gingerbeardman commented Apr 20, 2024

These days (6 years later) my advice is to use a different editor when working with international files.

I use CotEditor which has impeccable text encoding support due to it being a well-written native macOS app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality file-encoding File encoding type issues *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

6 participants