Skip to content

Is it possible automatically detect(guess) the encoding of a file #2

Open

Description

@asmwarrior

So that:

Set source encoding

This option can be avoid.

This has another benefit: for example, if the input file is already UTF8, we don't need to change it.

Activity

  1. gonejack commented on Jul 22, 2022

    @gonejack
    Owner

    Hi, @asmwarrior

    Would you like to try v1.0.4 which contains auto-detection by running

    go install github.com/gonejack/transcode@latest

  2. asmwarrior commented on Jul 22, 2022

    @asmwarrior
    Author

    Hi, thanks, I don't have a go build environment, so I think I will try the prebuild binaries here:

    https://github.com/gonejack/transcode/releases/tag/v1.0.4

    BTW: what I think the best way is something like this:
    https://github.com/amrali-eg/EncodingChecker

    EncodingChecker can automatically detect the encoding, and do a convert. But It is a Windows dotNet tool, and your tool is cross platform, also a command line tool is more flexible.

  3. flawrist commented on Jun 1, 2025

    @flawrist

    Alas, the automatic detection does not work on my end as expected.

    Source: hello.txt

    Windows 7 x64, transcode 1.0.8

    $ transcode hello.txt
    �ਢ¥â, ¬¨à!
    
    $ transcode -s cp866 hello.txt
    Привет, мир!
  4. gonejack commented on Jun 7, 2025

    @gonejack
    Owner

    Hi @sergeevabc

    Thanks for you report.

    Would you please try this newer version just released with better charset detection.

    https://github.com/gonejack/transcode/releases/tag/v1.0.9

  5. flawrist commented on Jun 7, 2025

    @flawrist

    @gonejack, thank you for taking the time to delve into the problem.
    I confirm that transcode v1.0.9 displays the aforementioned hello.txt file as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions