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 +4 -4
- data/CHANGES +9 -0
- data/README.md +5 -0
- data/ext/stringprep.c +4 -1
- data/test/tc_Stringprep.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d37d4b698b2005b38d843ba1d8eaee2375d6d14cd1d02b9ccc58d8655229f0c
|
4
|
+
data.tar.gz: c55099a450b32761493ae36aa0cdaa9f973bb24c4f690713d8a3d06056a6f451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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;
|
data/test/tc_Stringprep.rb
CHANGED
@@ -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.
|
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-
|
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
|