micro-editor / micro-editor/micro
Peculiar Dos-Unix Unicode bug
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
-
Run
micro create.cmd, Add a few linesmkdir "Hello dear"&mkdir "Привет дорогой", then Save and Quit.
-
Run
create.cmd. We see that 2 dirs are successfully created. Delete them for now. -
Run
micro create.cmdagain. This time it’s notdos, suddenly it’sunix. Add a new linemkdir 123, Save, Quit.
-
This time
create.cmdwon’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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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