Skip to content

A small wrapper around a Java implementation of Mozilla's automatic charset detection algorithm.

License

Notifications You must be signed in to change notification settings

olivervaga/charset-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Charset Detector

This is a wrapper around a Java implementation of Mozilla's automatic charset detection algorithm.

The original implementation can be found here.

Dependencies

First grab the charset-detector.jar file from the project root.

Then get the original Java implementation. Download here or just get it from the lib folder in the project.

Usage

Easy, there are three static methods: CharsetDetector.detectCharset(String filename); CharsetDetector.detectCharset(File file); CharsetDetector.detectCharset(InputStream inStream);

Calling any of those will try to guess the charset of the file and if it finds one, it returns the charset's name as a String (e.g. "UTF-8) or if no charset can be guessed, it returns "nomatch".

About

A small wrapper around a Java implementation of Mozilla's automatic charset detection algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages