encoding_name

Normalizer of encoding name for Crystal (to use it in crystal internal encoder-decoder)

EncodingName

Normalizer of encoding name for Crystal (to use it in crystal internal encoder-decoder)

Installation

Add this to your application's shard.yml:

dependencies:
  encoding_name:
    github: kostya/encoding_name

Usage

require "encoding_name"

p EncodingName.new("cp-1251").normalize
# => "CP1251"
p EncodingName.new("Windows 1251").normalize
# => "CP1251"
p EncodingName.new("uft8", find_similar: true).normalize
# => "UTF-8"
p EncodingName.new("Unicode").normalize
# => "UTF-8"
p EncodingName.new("asdfdsaf").normalize
# => nil

Repository

encoding_name

Owner
Statistic
  • 3
  • 0
  • 0
  • 1
  • 1
  • over 6 years ago
  • February 10, 2016
License

MIT License

Links
Synced at

Sat, 21 Dec 2024 11:31:20 GMT

Languages