Git Product home page Git Product logo

chardet's Introduction

chardet's People

Contributors

saintfish avatar task4233 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chardet's Issues

This seems to be a bug??

I try to read the source code。

func newRecognizer_8859_2(language string, ngram *[64]uint32) *recognizerSingleByte {
	return &recognizerSingleByte{
		charset:          "ISO-8859-2",
		hasC1ByteCharset: "windows-1250",
		language:         language,
		charMap:          &charMap_8859_2,
		ngram:            ngram,
	}
}

func newRecognizer_8859_2_cs() *recognizerSingleByte {
	return newRecognizer_8859_1("cs", &ngrams_8859_2_cs)
}
func newRecognizer_8859_2_hu() *recognizerSingleByte {
	return newRecognizer_8859_1("hu", &ngrams_8859_2_hu)
}
func newRecognizer_8859_2_pl() *recognizerSingleByte {
	return newRecognizer_8859_1("pl", &ngrams_8859_2_pl)
}
func newRecognizer_8859_2_ro() *recognizerSingleByte {
	return newRecognizer_8859_1("ro", &ngrams_8859_2_ro)
}

https://github.com/saintfish/chardet/blob/master/single_byte.go 315
According to the function naming rule,maybe

func newRecognizer_8859_2_cs() *recognizerSingleByte {
	return newRecognizer_8859_2("cs", &ngrams_8859_2_cs)
}

Documentation link goes to a link farm

The README links to http://go.pkgdoc.org/github.com/saintfish/chardet, but it unfortunately seems that pkgdoc.org has been remade into a link farm, peddling links for products to rid dogs of fleas and humans of unwanted extra pounds. The documentation for this library and others sadly seems to have gone missing on that site.

A little sample of the computer-generated haiku I found when I visited:

Flexpet For Dogs In Maine,ME
proper enzymes to
digest it anyway.Feeding your pet
Just like you or I,
incredibly
playful since he once was. This
...

ISO-8859-2 , GB-18030 and ISO-2022

  1. newRecognizer_8859_2_xx function should return newRecognizer_8859_2(xx) which uses ISO-8859-2 rather than newRecognizer_8859_1(xx) which uses ISO-8859-1.

chardet/single_byte.go

Lines 325 to 336 in 3af4cd4

func newRecognizer_8859_2_cs() *recognizerSingleByte {
return newRecognizer_8859_1("cs", &ngrams_8859_2_cs)
}
func newRecognizer_8859_2_hu() *recognizerSingleByte {
return newRecognizer_8859_1("hu", &ngrams_8859_2_hu)
}
func newRecognizer_8859_2_pl() *recognizerSingleByte {
return newRecognizer_8859_1("pl", &ngrams_8859_2_pl)
}
func newRecognizer_8859_2_ro() *recognizerSingleByte {
return newRecognizer_8859_1("ro", &ngrams_8859_2_ro)
}

  1. As #2 and #3 says, GB18030 should be GB18030.

"GB-18030",

  1. ISO-2022-XX charsets language should be ja, ko and cn

chardet/2022.go

Lines 83 to 101 in 3af4cd4

func newRecognizer_2022JP() *recognizer2022 {
return &recognizer2022{
"ISO-2022-JP",
escapeSequences_2022JP,
}
}
func newRecognizer_2022KR() *recognizer2022 {
return &recognizer2022{
"ISO-2022-KR",
escapeSequences_2022KR,
}
}
func newRecognizer_2022CN() *recognizer2022 {
return &recognizer2022{
"ISO-2022-CN",
escapeSequences_2022CN,
}

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.