idn-ruby 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2570c09d706246f8a0ca7371e0dfa865024e5d2d4e0749109c02ae22e19f2e7
4
- data.tar.gz: 31864ba33c666b02dc29f515602ba75b46d712246e06e4e9de9f29f8215c1071
3
+ metadata.gz: 4d37d4b698b2005b38d843ba1d8eaee2375d6d14cd1d02b9ccc58d8655229f0c
4
+ data.tar.gz: c55099a450b32761493ae36aa0cdaa9f973bb24c4f690713d8a3d06056a6f451
5
5
  SHA512:
6
- metadata.gz: 6e0c1bb1b1bdd659a7d2abef20362053758121195ec42aec3f6a646db8a20e876e36438666aac0a626ea3f70c8f3aaee4db6f478d844a674311d1f4f286987de
7
- data.tar.gz: 42ebf3aed3ffb81249a01106a205b47d4488dbc16b312f2872dfff4deea857f54ea3788924a2bc6048abab6ae51808018179299367276cbbd7440c011805737e
6
+ metadata.gz: 3733b52a4e27acce408ef9c6a1a13a164030dc2a7b0a9b6b805da2161359b9d39b50f0c7f567b6a75a22929d020c5b05c4161590823b43b443af9ce9d5d18445
7
+ data.tar.gz: 46a28b9dbedc732b705fce2975c67a61c28636a7bf1bc7865914e8956c613942c7421503c0718ae2167e3b64897a13fa0757bba3c1d86fe779be06e0260f76f4
data/CHANGES CHANGED
@@ -1,3 +1,12 @@
1
+ Changes with IDN 0.1.4 (2021-11-02)
2
+
3
+ * nfkc_normalize raises ArgumentError instead of returning nil for
4
+ invalid utf-8 strings.
5
+
6
+ Changes with IDN 0.1.3 (2021-11-01)
7
+
8
+ * Fixed segv in latest ruby-head with bad utf-8
9
+
1
10
  Changes with IDN 0.1.2 (2021-06-10)
2
11
 
3
12
  * add missing includes
data/README.md CHANGED
@@ -70,6 +70,11 @@ gem install --remote --test idn -- \
70
70
  --with-idn-include=/path/to/non/standard/location/include
71
71
  ```
72
72
 
73
+ #### Apple silicon
74
+ ```
75
+ gem install idn-ruby -- --with-idn-dir=$(brew --prefix libidn)
76
+ ```
77
+
73
78
  #### Semi-automatic installation with Rake
74
79
 
75
80
  If you are not able to or don't want to use RubyGems you can simply
data/ext/stringprep.c CHANGED
@@ -155,7 +155,10 @@ static VALUE nfkc_normalize(VALUE self, VALUE str)
155
155
 
156
156
  str = rb_check_convert_type(str, T_STRING, "String", "to_s");
157
157
  buf = stringprep_utf8_nfkc_normalize(RSTRING_PTR(str), RSTRING_LEN(str));
158
-
158
+ if (!buf) {
159
+ rb_raise(rb_eArgError, "Invalid string or encoding, normalize failed");
160
+ return Qnil;
161
+ }
159
162
  retv = rb_utf8_str_new_cstr(buf);
160
163
  idn_free(buf);
161
164
  return retv;
@@ -77,5 +77,9 @@ class Test_Stringprep < Test::Unit::TestCase
77
77
  rc = Stringprep.nfkc_normalize(val[0])
78
78
  assert_equal(val[1], rc, "TestCase #{key} failed")
79
79
  end
80
+
81
+ assert_raise(ArgumentError, "TestCase \xE8 failed") do
82
+ Stringprep.nfkc_normalize("\xE8")
83
+ end
80
84
  end
81
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idn-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Abele
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-10 00:00:00.000000000 Z
12
+ date: 2021-11-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: "\n Ruby Bindings for the GNU LibIDN library, an implementation of
15
15
  the\n Stringprep, Punycode and IDNA specifications defined by the IETF\n Internationalized