iconv 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/Rakefile +6 -6
- data/ext/iconv/iconv.c +10 -4
- data/lib/iconv/version.rb +1 -1
- data/test/test_basic.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f5a276d2517ce5592e1bbe94c3c8897bdaa70eb8d52fe334746ea8dd287013f
|
4
|
+
data.tar.gz: ec2d9899c3ce1f58aefab4516f2d79da7b301ded1e27473bc825645f7710e919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b43b19ba95361b57c2a3ff7778f344cb9ad5aeef98b24089fc4a698c5ebd286590ac76fcf9e274c799050fc02220219b090c6dd3c0df07697904348bbde36a9b
|
7
|
+
data.tar.gz: 609d4ab133902601820e5c4478387c7049fbedb2ce74b0def6c66c390e6fe886cf39697a4a2eb31544bfde98e1375b9a5aced9cd223711b64c0db84d5ace4623
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ NAME = 'iconv'
|
|
7
7
|
# rule to build the extension: this says
|
8
8
|
# that the extension should be rebuilt
|
9
9
|
# after any change to the files in ext
|
10
|
-
file "lib/#{NAME}/#{NAME}
|
10
|
+
file "lib/#{NAME}/#{NAME}.#{RbConfig::CONFIG['DLEXT']}" =>
|
11
11
|
Dir.glob("ext/#{NAME}/*{.rb,.c}") do
|
12
12
|
Dir.chdir("ext/#{NAME}") do
|
13
13
|
# this does essentially the same thing
|
@@ -15,19 +15,19 @@ file "lib/#{NAME}/#{NAME}.so" =>
|
|
15
15
|
ruby "extconf.rb", *ARGV.grep(/\A--/)
|
16
16
|
sh "make", *ARGV.grep(/\A(?!--)/)
|
17
17
|
end
|
18
|
-
cp "ext/#{NAME}/#{NAME}
|
18
|
+
cp "ext/#{NAME}/#{NAME}.#{RbConfig::CONFIG['DLEXT']}", "lib/#{NAME}"
|
19
19
|
end
|
20
20
|
|
21
21
|
# make the :test task depend on the shared
|
22
22
|
# object, so it will be built automatically
|
23
23
|
# before running the tests
|
24
|
-
task :test => "lib/#{NAME}/#{NAME}
|
24
|
+
task :test => "lib/#{NAME}/#{NAME}.#{RbConfig::CONFIG['DLEXT']}"
|
25
25
|
|
26
26
|
# use 'rake clean' and 'rake clobber' to
|
27
27
|
# easily delete generated files
|
28
|
-
CLEAN.include(
|
29
|
-
CLEAN.include(
|
30
|
-
CLOBBER.include(
|
28
|
+
CLEAN.include("ext/**/*{.o,.log,.#{RbConfig::CONFIG['DLEXT']}}")
|
29
|
+
CLEAN.include("ext/**/Makefile")
|
30
|
+
CLOBBER.include("lib/**/*.#{RbConfig::CONFIG['DLEXT']}")
|
31
31
|
|
32
32
|
# the same as before
|
33
33
|
Rake::TestTask.new do |t|
|
data/ext/iconv/iconv.c
CHANGED
@@ -75,8 +75,14 @@ rb_sys_fail_str(VALUE msg)
|
|
75
75
|
#endif
|
76
76
|
|
77
77
|
#ifdef HAVE_RUBY_ENCODING_H
|
78
|
-
# define ICONV_ENCODING_SET(obj,idx) rb_ivar_set(obj,
|
79
|
-
|
78
|
+
# define ICONV_ENCODING_SET(obj,idx) rb_ivar_set(obj, id_encindex, INT2FIX(idx))
|
79
|
+
static int
|
80
|
+
iconv_get_encindex(VALUE obj, ID id_encindex)
|
81
|
+
{
|
82
|
+
VALUE num_or_nil = rb_ivar_get(obj, id_encindex);
|
83
|
+
return NIL_P(num_or_nil) ? 0 : FIX2INT(num_or_nil);
|
84
|
+
}
|
85
|
+
# define ICONV_ENCODING_GET(obj) iconv_get_encindex(obj, id_encindex)
|
80
86
|
#else
|
81
87
|
# define ICONV_ENCODING_GET(a) 0
|
82
88
|
#endif
|
@@ -156,7 +162,7 @@ struct rb_iconv_opt_t
|
|
156
162
|
VALUE discard_ilseq;
|
157
163
|
};
|
158
164
|
|
159
|
-
static ID id_transliterate, id_discard_ilseq,
|
165
|
+
static ID id_transliterate, id_discard_ilseq, id_encindex;
|
160
166
|
|
161
167
|
static VALUE rb_eIconvInvalidEncoding;
|
162
168
|
static VALUE rb_eIconvFailure;
|
@@ -1317,7 +1323,7 @@ Init_iconv(void)
|
|
1317
1323
|
rb_failed = rb_intern("failed");
|
1318
1324
|
id_transliterate = rb_intern("transliterate");
|
1319
1325
|
id_discard_ilseq = rb_intern("discard_ilseq");
|
1320
|
-
|
1326
|
+
id_encindex = rb_intern("encindex");
|
1321
1327
|
|
1322
1328
|
rb_gc_register_address(&charset_map);
|
1323
1329
|
charset_map = rb_hash_new();
|
data/lib/iconv/version.rb
CHANGED
data/test/test_basic.rb
CHANGED
@@ -56,4 +56,12 @@ class TestIconv::Basic < TestIconv
|
|
56
56
|
Iconv.iconv("X-UNKNOWN-1", "X-UNKNOWN-2") {break}
|
57
57
|
}
|
58
58
|
end
|
59
|
+
|
60
|
+
def test_github_issue_16
|
61
|
+
i = Iconv.new('SHIFT_JISX0213', 'UTF-8')
|
62
|
+
ret = i.iconv('ほげ')
|
63
|
+
ret << i.iconv(nil)
|
64
|
+
i.close
|
65
|
+
assert_equal "\x82\xD9\x82\xB0".b, ret
|
66
|
+
end
|
59
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iconv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NARUSE, Yui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: iconv wrapper library
|
14
14
|
email:
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.0.
|
57
|
+
rubygems_version: 3.0.0.beta3
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: iconv wrapper library
|