micro-editor / micro-editor/micro

Peculiar Dos-Unix Unicode bug

Open
#2,066 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Background

Windows 7 (chcp 65001), micro 2.0.8 (cfcb2e45).

Aggrrhh
  1. Run micro create.cmd, Add a few lines mkdir "Hello dear" & mkdir "Привет дорогой", then Save and Quit.

  2. Run create.cmd. We see that 2 dirs are successfully created. Delete them for now.

  3. Run micro create.cmd again. This time it’s not dos, suddenly it’s unix. Add a new line mkdir 123, Save, Quit.

  4. This time create.cmd won’t be able to create one dir (with a Russian name) as follows

    '�вет' is not recognized as an internal or external command, operable program or batch file.
    
Workaround

If we run micro create.cmd once again, then CTRL+E, then set fileformat dos, then Save, it will work.

Conclusion

Something is not right here, because create.cmd with the same contents created by other editors works as expected.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sequence on Windows 7 with chcp 65001 using micro create.cmd, including the repeated edit and fileformat changes. Start by tracing fileformat detection and save behavior for DOS and Unix files; done means reopening and saving the batch file preserves its DOS format so the Cyrillic directory command still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.