Code Monkey home page Code Monkey logo

Comments (1)

Jehan avatar Jehan commented on July 21, 2024

No uchardet is made to detect correctly coded files. I don't think that it should be its role to detect broken encodings. Actually even if just considering the cases of single corruption (not reopened again and again with other encodings), we would get nb-of-encoding*nb-of-encoding cases.
Just for this reason, I would reject the feature request. uchardet should remain as simple as possible in its use cases. I am thinking about adding language detection since the algorithm is already doing it anyway (so we are already half the way), but that's about it.

Finally I am not even sure how feasible this would be with statistical algorithms. It would require generating statistics about every couple of encoding with datasets of files decoded by error in this given couple (actually even a 3-tuple because language matters), so that we get statistics data of characters and character sequences. Well not sure where to get this data reliably so we'd have to basically build it ourselves. That's a lot of work (that's already a lot of work to make data for every (lang, charset), now we'd have to get it for every (lang, charset1, charset2)?) for a very uncertain result.
So I'm thinking that uchardet algorithm is very efficient for charset detection, but I'm not sure how efficient it would be in charset decoding error detection. I guess someone would have to try. But it may turn out that another algorithm would be a better suit.

So thanks for the proposition, but I will close this feature request now.

from uchardet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.