iconv 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/ext/iconv/extconf.rb +3 -1
- data/ext/iconv/iconv.c +9 -1
- data/lib/iconv/version.rb +1 -1
- metadata +1 -2
- data/ext/iconv/depend +0 -2
data/.gitignore
CHANGED
data/ext/iconv/extconf.rb
CHANGED
@@ -5,9 +5,11 @@ dir_config("iconv")
|
|
5
5
|
conf = File.exist?(File.join($srcdir, "config.charset"))
|
6
6
|
conf = with_config("config-charset", enable_config("config-charset", conf))
|
7
7
|
|
8
|
+
have_func("rb_enc_get", "ruby/encoding.h")
|
9
|
+
have_func("st_lookup", "ruby/st.h")
|
8
10
|
if have_func("iconv", "iconv.h") or
|
9
11
|
have_library("iconv", "iconv", "iconv.h")
|
10
|
-
check_signedness("size_t")
|
12
|
+
check_signedness("size_t") rescue nil
|
11
13
|
if checking_for("const of iconv() 2nd argument") do
|
12
14
|
create_tmpsrc(cpp_include("iconv.h") + "---> iconv(cd,0,0,0,0) <---")
|
13
15
|
src = xpopen(cpp_command("")) {|f|f.read}
|
data/ext/iconv/iconv.c
CHANGED
@@ -13,12 +13,18 @@
|
|
13
13
|
|
14
14
|
**********************************************************************/
|
15
15
|
|
16
|
-
#include "ruby
|
16
|
+
#include "ruby.h"
|
17
17
|
#include <errno.h>
|
18
18
|
#include <iconv.h>
|
19
19
|
#include <assert.h>
|
20
|
+
#ifdef HAVE_RUBY_ST_H
|
20
21
|
#include "ruby/st.h"
|
22
|
+
#else /* assume 1.8 */
|
23
|
+
#include "st.h"
|
24
|
+
#endif
|
25
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
21
26
|
#include "ruby/encoding.h"
|
27
|
+
#endif
|
22
28
|
|
23
29
|
/*
|
24
30
|
* Document-class: Iconv
|
@@ -932,6 +938,7 @@ iconv_iconv(int argc, VALUE *argv, VALUE self)
|
|
932
938
|
length = NIL_P(n2) ? -1 : NUM2LONG(n2);
|
933
939
|
}
|
934
940
|
}
|
941
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
935
942
|
if (start > 0 || length > 0) {
|
936
943
|
rb_encoding *enc = rb_enc_get(str);
|
937
944
|
const char *s = RSTRING_PTR(str), *e = s + RSTRING_LEN(str);
|
@@ -943,6 +950,7 @@ iconv_iconv(int argc, VALUE *argv, VALUE self)
|
|
943
950
|
length = rb_enc_nth(ps, e, length, enc) - ps;
|
944
951
|
}
|
945
952
|
}
|
953
|
+
#endif
|
946
954
|
|
947
955
|
return iconv_convert(VALUE2ICONV(cd), str, start, length, ENCODING_GET(self), NULL);
|
948
956
|
}
|
data/lib/iconv/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -26,7 +26,6 @@ files:
|
|
26
26
|
- README.md
|
27
27
|
- Rakefile
|
28
28
|
- ext/iconv/charset_alias.rb
|
29
|
-
- ext/iconv/depend
|
30
29
|
- ext/iconv/extconf.rb
|
31
30
|
- ext/iconv/iconv.c
|
32
31
|
- ext/iconv/mkwrapper.rb
|
data/ext/iconv/depend
DELETED