1
1
Fork
You've already forked ecformat
0

Fix wrong charset detection #57

Open
opened 2026年06月27日 16:45:58 +02:00 by BaumiCoder · 4 comments

Version of ecformat

0.2.0

Operating system

Linux

Version of your operating system (e.g. Debian 11, Arch Linux or Windows 11)

Manjaro Linux

Installation method

Binary from Codeberg package ecformat_bin

Steps to reproduce the bug

  1. Checkout github.com/rust-lang/rust at revision 267c4057bad01b0cf9733081d170c1358b4b3674
  2. Run ecformat check (or ecformat fix) on for example the following files:
    1. src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
    2. src/doc/rustdoc/src/unstable-features.md
    3. tests/ui/README.md

Expected result

A check passes without errors and a fix does not change anything.

Actual result

The check reports that the files have latin1 encoding and the fix changes some lines. These lines all have some special characters in there, such as a non-breaking space or 👻.

### Version of ecformat 0.2.0 ### Operating system Linux ### Version of your operating system (e.g. Debian 11, Arch Linux or Windows 11) Manjaro Linux ### Installation method Binary from Codeberg package ecformat_bin ### Steps to reproduce the bug 1. Checkout [github.com/rust-lang/rust at revision `267c4057bad01b0cf9733081d170c1358b4b3674`](https://github.com/rust-lang/rust/tree/267c4057bad01b0cf9733081d170c1358b4b3674) 2. Run `ecformat check` (or `ecformat fix`) on for example the following files: 1. src/doc/rustdoc/src/write-documentation/the-doc-attribute.md 2. src/doc/rustdoc/src/unstable-features.md 3. tests/ui/README.md ### Expected result A `check` passes without errors and a `fix` does not change anything. ### Actual result The `check` reports that the files have latin1 encoding and the `fix` changes some lines. These lines all have some special characters in there, such as a non-breaking space or 👻.
Author
Owner
Copy link

Another example is in line 333001 of this file. However, it seems that this patch files contains some binary data.

gitlab.com/kalilinux/build-scripts/kali-arm/-@af5bfb63f2/patches/pinebook-pro/pbp-5.14/0005-staging-add-rtl8723cs-driver.patch

Another example is in line 333001 of this file. However, it seems that this patch files contains some binary data. https://gitlab.com/kalilinux/build-scripts/kali-arm/-/blob/af5bfb63f242348e577492b16aa9816e7dc8a766/patches/pinebook-pro/pbp-5.14/0005-staging-add-rtl8723cs-driver.patch
Author
Owner
Copy link
Another example is a ® symbol in this file: https://github.com/pgjdbc/pgjdbc/blob/0b4077a529b2448cc55a6ca87b2be8667243c9ab/docs/content/documentation/logging.md
Author
Owner
Copy link
Another example are ö and ? in this file: https://github.com/spring-projects/spring-framework/blob/c5d7908a7876855c9385dcbb3ae24a3f67c42e01/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerIntegrationTests.java
Author
Owner
Copy link

A very special one is this file. It contains no special characters but mentions a charset in the text.

github.com/spring-projects/spring-framework@c5d7908a78/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/testviews_fr.properties

A very special one is this file. It contains no special characters but mentions a charset in the text. https://github.com/spring-projects/spring-framework/blob/c5d7908a7876855c9385dcbb3ae24a3f67c42e01/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/testviews_fr.properties
Sign in to join this conversation.
No Branch/Tag specified
main
chore/dependencies-0.2.0
bugfix/47-subdirectory-sections-are-not-considered
enhancement/no-colors-log-to-file
bugfix/Too-many-open-files-via-ConfigFile
bugfix/spelling_language-unparsable-values
feature/38-status-command
chore/add-pre-commit-installation-to-issue-template
chore/add-crate-installation-to-issue-template
enhancement/finalize-0.17.2-editorconfig-support
feature/8-spelling_language
feature/7-indentation
bugfix/CI-change-detection
feature/6-insert_final_newline
feature/5-trim_trailing_whitespace
feature/16-pre-commit
chore/dependencies-0.1.1
chore/33-Make-CI-and-pre-commit-more-reproducable
bugfix/28-docs.rs-build
feature/31-support-multiple-target-files
chore/25-remove-reuse-workarounds
chore/dependencies-badge
feature/11-Rust-crate-on-crates.io
chore/10-CI
chore/9-licenses
feature/4-end_of_line
feature/2-linters
feature/3-charset
feature/18-log-levels
feature/1-ignore-files
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
EditorConfig
0.17.2
Issues to support version 0.17.2 of the EditorConfig specification
Kind
Bug
Something is not working
Kind
Chore
Some tasks maintainig tasks
Kind
Documentation
Documentation changes
Kind
Enhancement
Improve existing functionality
Kind
Feature
New functionality
Kind
Testing
Issue or pull request related to testing
Packaging
About packaging the project for some platform
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
WIP
Work in progress (Assignee is working on this issue)
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BaumiCoder/ecformat#57
Reference in a new issue
BaumiCoder/ecformat
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?