zed icon indicating copy to clipboard operation
zed copied to clipboard

Cannot open file containing Shift-JIS encoded text

Open gingerbeardman opened this issue 1 year ago • 5 comments

Check for existing issues

  • [X] Completed

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

gingerbeardman avatar Jan 28 '24 15:01 gingerbeardman

Duplicate of #5348 ?

jansol avatar Jan 28 '24 19:01 jansol

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.

gingerbeardman avatar Jan 28 '24 20:01 gingerbeardman

Hmm, so more like #5294 then

jansol avatar Jan 28 '24 21:01 jansol

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

gingerbeardman avatar Jan 28 '24 21:01 gingerbeardman