microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.41k stars 29.33k forks source link

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

Closed gingerbeardman closed 1 year ago

gingerbeardman commented 6 years ago

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

Benefits

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:

vscodebot[bot] commented 6 years ago

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!

gingerbeardman commented 6 years ago

what a waste of time @bpasero

bpasero commented 6 years ago

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.

gingerbeardman commented 6 years ago

Thank you @bpasero — have a great day

vscodenpa commented 1 year ago

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!

gingerbeardman commented 1 year ago

Strong disagree.

4.5 years.

Multiple close and reopen.

What a farce.

bpasero commented 1 year ago

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 commented 6 months ago

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

gingerbeardman commented 6 months ago

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.