Skip to content

Commit

Permalink
Bump characteristics dependency / Allow GB1988 encoding (7bit ascii-l…
Browse files Browse the repository at this point in the history
…ike)
  • Loading branch information
janlelis committed Mar 31, 2017
1 parent 398cb42 commit 102442d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
@@ -1,8 +1,10 @@
## CHANGELOG

### 2.4.1
### 2.5.0

* Double check UTF-32 only on Ruby versions which contain the bug
* Bump characteristics dependency
* Allow GB1988 encoding (7bit ascii-like)

### 2.4.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@ Ruby library and CLI command that visualizes various Unicode and ASCII/single by
- Makes analyzing encodings easier
- Helps you with debugging strings
- Highlights invalid/special/blank bytes/characters/codepoints
- Supports *UTF-8*, *UTF-16LE*/*UTF-16BE*, *UTF-32LE*/*UTF-32BE*, *ISO-8859-X*, *Windows-125X*, *IBMX*, *CP85X*, *macX*, *TIS-620*/*Windows-874*, *KOI8-R*/*KOI8-U*, 7-Bit *ASCII*, and arbitrary *BINARY* data
- Supports *UTF-8*, *UTF-16LE*/*UTF-16BE*, *UTF-32LE*/*UTF-32BE*, *ISO-8859-X*, *Windows-125X*, *IBMX*, *CP85X*, *macX*, *TIS-620*/*Windows-874*, *KOI8-R*/*KOI8-U*, 7-Bit *ASCII*/*GB1988*, and arbitrary *BINARY* data

## Color Coding

Expand Down
1 change: 1 addition & 0 deletions lib/unibits.rb
Expand Up @@ -22,6 +22,7 @@ module Unibits
/^TIS-620$/,
/^Windows-874$/,
/^KOI8/,
/^GB1988$/,
)
).sort.freeze

Expand Down
7 changes: 7 additions & 0 deletions spec/unibits_spec.rb
Expand Up @@ -67,6 +67,13 @@
result.must_match "01000011"
end

it "works with GB1988" do
result = Paint.unpaint(Unibits.visualize("ASCII string".force_encoding('GB1988')))
result.must_match "C"
result.must_match "43"
result.must_match "01000011"
end

it "works with 'ISO-8859-X' encodings" do
string = "\xBC Idiosyncr\xE4tic\n\x91".force_encoding("ISO-8859-1")
result = Paint.unpaint(Unibits.visualize(string))
Expand Down
2 changes: 1 addition & 1 deletion unibits.gemspec
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'paint', '>= 0.9', '< 3.0'
gem.add_dependency 'unicode-display_width', '~> 1.1'
gem.add_dependency 'symbolify', '~> 1.0'
gem.add_dependency 'characteristics', '>= 0.5.2'
gem.add_dependency 'characteristics', '>= 0.7'
gem.add_dependency 'rationalist', '~> 2.0'

gem.required_ruby_version = "~> 2.0"
Expand Down

0 comments on commit 102442d

Please sign in to comment.