diff -Nru ruby-unicode-display-width-1.1.2/CHANGELOG.txt ruby-unicode-display-width-1.1.3/CHANGELOG.txt --- ruby-unicode-display-width-1.1.2/CHANGELOG.txt 2016-12-24 18:21:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/CHANGELOG.txt 2017-01-21 16:14:56.000000000 +0000 @@ -1,5 +1,9 @@ # CHANGELOG +## 1.1.3 + +- Fix that non-UTF-8 encodings do not throw errors, patch by @windwiny + ## 1.1.2 - Reduce memory consumption and increase performance, patch by @rrosenblum diff -Nru ruby-unicode-display-width-1.1.2/debian/changelog ruby-unicode-display-width-1.1.3/debian/changelog --- ruby-unicode-display-width-1.1.2/debian/changelog 2016-12-24 18:24:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/debian/changelog 2017-01-21 16:15:49.000000000 +0000 @@ -1,3 +1,10 @@ +ruby-unicode-display-width (1.1.3-1) unstable; urgency=medium + + * Team upload. + * New upstream release + + -- Michael Moll Sat, 21 Jan 2017 17:15:49 +0100 + ruby-unicode-display-width (1.1.2-1) unstable; urgency=medium * Team upload. diff -Nru ruby-unicode-display-width-1.1.2/debian/patches/use_debian_datadir.patch ruby-unicode-display-width-1.1.3/debian/patches/use_debian_datadir.patch --- ruby-unicode-display-width-1.1.2/debian/patches/use_debian_datadir.patch 2016-12-24 18:24:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/debian/patches/use_debian_datadir.patch 2017-01-21 16:15:49.000000000 +0000 @@ -2,7 +2,7 @@ +++ b/lib/unicode/display_width/constants.rb @@ -2,7 +2,8 @@ module DisplayWidth - VERSION = '1.1.2' + VERSION = '1.1.3' UNICODE_VERSION = "9.0.0".freeze - DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze + DEBIAN_DATA_DIRECTORY = '/usr/share/ruby-unicode-display-width/' diff -Nru ruby-unicode-display-width-1.1.2/lib/unicode/display_width/constants.rb ruby-unicode-display-width-1.1.3/lib/unicode/display_width/constants.rb --- ruby-unicode-display-width-1.1.2/lib/unicode/display_width/constants.rb 2016-12-24 18:21:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/lib/unicode/display_width/constants.rb 2017-01-21 16:14:56.000000000 +0000 @@ -1,6 +1,6 @@ module Unicode module DisplayWidth - VERSION = '1.1.2' + VERSION = '1.1.3' UNICODE_VERSION = "9.0.0".freeze DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze INDEX_FILENAME = (DATA_DIRECTORY + '/display_width.marshal.gz').freeze diff -Nru ruby-unicode-display-width-1.1.2/lib/unicode/display_width.rb ruby-unicode-display-width-1.1.3/lib/unicode/display_width.rb --- ruby-unicode-display-width-1.1.2/lib/unicode/display_width.rb 2016-12-24 18:21:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/lib/unicode/display_width.rb 2017-01-21 16:14:56.000000000 +0000 @@ -6,7 +6,7 @@ DEPTHS = [0x10000, 0x1000, 0x100, 0x10].freeze def self.of(string, ambiguous = 1, overwrite = {}) - res = string.unpack('U*'.freeze).inject(0){ |total_width, codepoint| + res = string.codepoints.inject(0){ |total_width, codepoint| index_or_value = INDEX codepoint_depth_offset = codepoint DEPTHS.each{ |depth| diff -Nru ruby-unicode-display-width-1.1.2/MIT-LICENSE.txt ruby-unicode-display-width-1.1.3/MIT-LICENSE.txt --- ruby-unicode-display-width-1.1.2/MIT-LICENSE.txt 2016-12-24 18:21:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/MIT-LICENSE.txt 2017-01-21 16:14:56.000000000 +0000 @@ -1,6 +1,6 @@ The MIT LICENSE -Copyright (c) 2011, 2015-2016 Jan Lelis +Copyright (c) 2011, 2015-2017 Jan Lelis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ruby-unicode-display-width-1.1.2/README.md ruby-unicode-display-width-1.1.3/README.md --- ruby-unicode-display-width-1.1.2/README.md 2016-12-24 18:21:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/README.md 2017-01-21 16:14:56.000000000 +0000 @@ -96,7 +96,7 @@ ## Copyright & Info -- Copyright (c) 2011, 2015-2016 Jan Lelis, http://janlelis.com, released under the MIT +- Copyright (c) 2011, 2015-2017 Jan Lelis, http://janlelis.com, released under the MIT license - Early versions based on runpaint's unicode-data interface: Copyright (c) 2009 Run Paint Run Run - Unicode data: http://www.unicode.org/copyright.html#Exhibit1 diff -Nru ruby-unicode-display-width-1.1.2/spec/display_width_spec.rb ruby-unicode-display-width-1.1.3/spec/display_width_spec.rb --- ruby-unicode-display-width-1.1.2/spec/display_width_spec.rb 2016-12-24 18:21:46.000000000 +0000 +++ ruby-unicode-display-width-1.1.3/spec/display_width_spec.rb 2017-01-21 16:14:56.000000000 +0000 @@ -123,4 +123,10 @@ expect( "\t".display_width(1, 0x09 => 12) ).to eq 12 end end + + describe '[encoding]' do + it 'works with non-utf8 Unicode encodings' do + expect( 'À'.encode("UTF-16LE").display_width ).to eq 1 + end + end end