iconv 1.0.5 → 1.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ade5a248ad7f987695736e3ca42183dd22239a73
4
- data.tar.gz: 99e537f2952a300717cfae04dac1be83b540b96d
2
+ SHA256:
3
+ metadata.gz: f18f6f9c75a01045651000747af72f97d71a633a1e3612597bc0afe4beeec73b
4
+ data.tar.gz: 1b7782c0429b79ab5d6b971e2c1ccc98878c7fe20e91baf5cb10aafc01cc7e50
5
5
  SHA512:
6
- metadata.gz: 6b2429d50669f11196f317ce0100843a0b636ad828f01ea3370045a9165182b6e5bbbebfa15960ce267e64cdd5a7efa3465265e64f38beb60bd3cb59664c6aab
7
- data.tar.gz: ddda802caed973d6c14d5974b3c5f88e18ce2d969aaeeea3a3668fa565a3dc4412cb56cb6be5fb232715833bb170f4db1eb78b9c372e085281af2e0971f2b80b
6
+ metadata.gz: a94e61fcf05f7a20d5046c8dc589115d0f4efb0683c051d8cf69d4908bb6848a641959d079442d2d7a8261cbe58706f7bc1aca6ae6e2d8bde24b7e114d904f8a
7
+ data.tar.gz: 1c8020bf2888c9fdefcdbb1b34675b2943d1a871cc54756b34e17f3dae6908c9ba94a2a38550ddbaf0453fd82a1b0c12cc103d9d8cb2053d2c78c79a3b7b0514
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - ruby-head
4
+ - 2.6.0
4
5
  - 2.5.0
5
6
  - 2.4.3
6
7
  - 2.3.6
@@ -50,7 +50,6 @@ rb_set_errinfo(VALUE err)
50
50
  extern VALUE ruby_errinfo;
51
51
  ruby_errinfo = err;
52
52
  }
53
- #define ENCODING_GET(a) 0
54
53
  VALUE
55
54
  rb_sprintf(const char *format, ...)
56
55
  {
@@ -75,6 +74,13 @@ rb_sys_fail_str(VALUE msg)
75
74
  }
76
75
  #endif
77
76
 
77
+ #ifdef HAVE_RUBY_ENCODING_H
78
+ # define ICONV_ENCODING_SET(obj,idx) rb_ivar_set(obj, id_encoding, rb_enc_from_encoding(rb_enc_from_index(idx)))
79
+ # define ICONV_ENCODING_GET(obj) rb_enc_to_index(rb_to_encoding(rb_ivar_get(obj, id_encoding)))
80
+ #else
81
+ # define ICONV_ENCODING_GET(a) 0
82
+ #endif
83
+
78
84
  /*
79
85
  * Document-class: Iconv
80
86
  *
@@ -150,7 +156,7 @@ struct rb_iconv_opt_t
150
156
  VALUE discard_ilseq;
151
157
  };
152
158
 
153
- static ID id_transliterate, id_discard_ilseq;
159
+ static ID id_transliterate, id_discard_ilseq, id_encoding;
154
160
 
155
161
  static VALUE rb_eIconvInvalidEncoding;
156
162
  static VALUE rb_eIconvFailure;
@@ -734,7 +740,7 @@ iconv_initialize(int argc, VALUE *argv, VALUE self)
734
740
  DATA_PTR(self) = NULL;
735
741
  DATA_PTR(self) = (void *)ICONV2VALUE(iconv_create(to, from, &opt, &idx));
736
742
  #ifdef HAVE_RUBY_ENCODING_H
737
- if (idx >= 0) ENCODING_SET(self, idx);
743
+ if (idx >= 0) ICONV_ENCODING_SET(self, idx);
738
744
  #endif
739
745
  return self;
740
746
  }
@@ -760,7 +766,7 @@ iconv_s_open(int argc, VALUE *argv, VALUE self)
760
766
 
761
767
  self = Data_Wrap_Struct(self, NULL, ICONV_FREE, (void *)cd);
762
768
  #ifdef HAVE_RUBY_ENCODING_H
763
- if (idx >= 0) ENCODING_SET(self, idx);
769
+ if (idx >= 0) ICONV_ENCODING_SET(self, idx);
764
770
  #endif
765
771
 
766
772
  if (rb_block_given_p()) {
@@ -946,7 +952,7 @@ iconv_init_state(VALUE self)
946
952
  {
947
953
  iconv_t cd = VALUE2ICONV((VALUE)DATA_PTR(self));
948
954
  DATA_PTR(self) = NULL;
949
- return iconv_convert(cd, Qnil, 0, 0, ENCODING_GET(self), NULL);
955
+ return iconv_convert(cd, Qnil, 0, 0, ICONV_ENCODING_GET(self), NULL);
950
956
  }
951
957
 
952
958
  static VALUE
@@ -1027,7 +1033,7 @@ iconv_iconv(int argc, VALUE *argv, VALUE self)
1027
1033
  #endif
1028
1034
  }
1029
1035
 
1030
- return iconv_convert(VALUE2ICONV(cd), str, start, length, ENCODING_GET(self), NULL);
1036
+ return iconv_convert(VALUE2ICONV(cd), str, start, length, ICONV_ENCODING_GET(self), NULL);
1031
1037
  }
1032
1038
 
1033
1039
  /*
@@ -1043,7 +1049,7 @@ iconv_conv(int argc, VALUE *argv, VALUE self)
1043
1049
  {
1044
1050
  iconv_t cd = VALUE2ICONV(check_iconv(self));
1045
1051
  VALUE str, s;
1046
- int toidx = ENCODING_GET(self);
1052
+ int toidx = ICONV_ENCODING_GET(self);
1047
1053
 
1048
1054
  str = iconv_convert(cd, Qnil, 0, 0, toidx, NULL);
1049
1055
  if (argc > 0) {
@@ -1311,6 +1317,7 @@ Init_iconv(void)
1311
1317
  rb_failed = rb_intern("failed");
1312
1318
  id_transliterate = rb_intern("transliterate");
1313
1319
  id_discard_ilseq = rb_intern("discard_ilseq");
1320
+ id_encoding = rb_intern("encoding");
1314
1321
 
1315
1322
  rb_gc_register_address(&charset_map);
1316
1323
  charset_map = rb_hash_new();
@@ -1,3 +1,3 @@
1
1
  class Iconv
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  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.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - NARUSE, Yui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-25 00:00:00.000000000 Z
11
+ date: 2019-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: iconv wrapper library
14
14
  email:
@@ -54,8 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubyforge_project:
58
- rubygems_version: 2.6.13
57
+ rubygems_version: 3.0.1
59
58
  signing_key:
60
59
  specification_version: 4
61
60
  summary: iconv wrapper library