Socket
Book a DemoInstallSign in
Socket

uchardet

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uchardet

0.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Uchardet

Fast character set encoding detection using International Components for Unicode library: International Components for Unicode

Installation

Add this line to your application's Gemfile:

gem 'uchardet'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uchardet

Usage

  require 'open-uri'
  require 'uchardet'
  
  text = open('https://raw.githubusercontent.com/dmgk/uchardet/master/test/samples/shift_jis.txt').read
  encoding = ICU::UCharsetDetector.detect(text)
  encoding # => {:encoding=>"Shift_JIS", :confidence=>100, :language=>"ja"}

From command line:

  $ uchardet
  
  Usage: uchardet [options] file
      -l, --list                       Display list of detectable character sets.
      -s, --strip                      Strip HTML or XML markup before detection.
      -e, --encoding                   Hint the charset detector about possible encoding.
      -a, --all                        Show all matching encodings.
      -h, --help                       Show this help message.
      -v, --version                    Show version.

  $ uchardet `which uchardet`
  
  ISO-8859-1 (confidence 25%)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dmgk/uchardet

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 29 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.