albfernandez / juniversalchardet

Originally exported from code.google.com/p/juniversalchardet
Other
339 stars 60 forks source link

Detector returning null when file is US-ASCII #30

Closed guibernardi closed 4 years ago

guibernardi commented 4 years ago

Hi,

I have some files with us-ascii charset, for example on MacOs:

file -I file123.csv 
file123.csv: text/plain; charset=us-ascii

When I call the method for detect the charset I'm receiving a null:

UniversalDetector.detectCharset(file.getInputStream());

Is something that I'm doing wrong or the dependency doesn't support this charset?

Thanks!

albfernandez commented 4 years ago

I've released a new version that detect US-ASCII. Hope it help you

guibernardi commented 4 years ago

It works, thank you!