zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.97k stars 3.06k forks source link

Cannot open file containing Shift-JIS encoded text #6938

Closed gingerbeardman closed 2 months ago

gingerbeardman commented 9 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Cannot open file containing Shift-JIS encoded text

eg. main.cpp in https://web.archive.org/web/20060626155423/http://www.ueno.no-ip.org:80/~jinzo/WinCE/download/JZP16/102/JZP16-102-src.zip

Environment

Zed: v0.119.20 (Zed) OS: macOS 14.3.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Related: #5250

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

2024-01-28T15:44:43 [ERROR] crates/project_panel/src/project_panel.rs:273: ProjectPath { worktree_id: WorktreeId(21474836532), path: "main.cpp" } opening failure: stream did not contain valid UTF-8
jansol commented 9 months ago

Duplicate of

gingerbeardman commented 9 months ago

Perhaps, but I do not agree with the "expected behaviour" in that issue.

My expected behaviour is for the file to be opened, able to be edited, and saved back in its original encoding.

If there's an option to convert to UTF-8 that's great it would be useful sometimes, but it should not be default. My files are in a certain encoding for a reason and I wish them to stay that way unless I choose otherwise.

CotEditor is a great example of how an editor should deal with different encodings.

jansol commented 9 months ago

Hmm, so more like

gingerbeardman commented 9 months ago

Related, in a way, but no - not the same.

tiann commented 9 months ago

bugreport-oriole_beta-AP11.231215.007-2024-02-01-10-23-06.txt.zip

Same issue here

notpeter commented 2 months ago

Hi @gingerbeardman,

I'm going to close this in favor of a unified tracking issue. Please 👍 upvote that issue to prioritize and subscribe if you would like to receive updates. Thanks for reporting.

gingerbeardman commented 2 months ago

Ok cool