diff --git a/recipes/compile/ruby-2.3.4/0005-utf-8-default-encoding.patch b/recipes/compile/ruby-2.3.4/0005-utf-8-default-encoding.patch deleted file mode 100644 index 4bf795057..000000000 --- a/recipes/compile/ruby-2.3.4/0005-utf-8-default-encoding.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/ruby.c b/ruby.c -index 3f89bb4..a46aea3 100644 ---- a/ruby.c -+++ b/ruby.c -@@ -1553,7 +1553,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) - enc = rb_enc_from_index(opt->ext.enc.index); - } - else { -- enc = lenc; -+ enc = rb_utf8_encoding(); - } - rb_enc_set_default_external(rb_enc_from_encoding(enc)); - if (opt->intern.enc.index >= 0) { diff --git a/recipes/compile/ruby-2.3.4/PKGBUILD.erb b/recipes/compile/ruby-2.3.4/PKGBUILD.erb index fbff646ff..d6030a489 100644 --- a/recipes/compile/ruby-2.3.4/PKGBUILD.erb +++ b/recipes/compile/ruby-2.3.4/PKGBUILD.erb @@ -20,7 +20,6 @@ source=("https://cache.ruby-lang.org/pub/ruby/${pkgver%.*}/${_realname}-${pkgver 0002-use-gnu-printf.patch 0003-fix-check-types.patch 0004-exclude-changelog-from-rdoc.patch - 0005-utf-8-default-encoding.patch 0006-fix-conversion-warning-win32-powl.patch 0007-rbinstall-destdir.patch ruby.ico @@ -33,7 +32,6 @@ sha256sums=('cd9808bb53824d6edb58beaadd3906cb23b987438ce75ab7bb279b2229930e2f' '578bd0830fe96efc7656c732ec46b0658fc436a7a30d8945cf3b8240797809f0' '846d73ad389249c54ff4e009ad2fd4cdbc46714fce25c724bc706b3ec2f2fe3a' '389236bdca5f283adde9b4b56febcfc25e228716e06a0edc21ea8fd7f27b75fa' - '76159e9fcefba7220e7b22fc1825714d5b734e1613eda53ad9fcc66c04f33f78' 'e7f83bc6e3b7ddadb5e3b14aa7d3a4e30eb97aea02df38796ca78714ad20e9b7' '02382ec3b9e42d7dbb58edad3e41c361d98871711bb2f0320082c2acc6a82e2e' '6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22' @@ -45,7 +43,6 @@ prepare() { patch -p1 -i ${srcdir}/0002-use-gnu-printf.patch patch -p1 -i ${srcdir}/0003-fix-check-types.patch patch -p1 -i ${srcdir}/0004-exclude-changelog-from-rdoc.patch - patch -p1 -i ${srcdir}/0005-utf-8-default-encoding.patch patch -p1 -i ${srcdir}/0006-fix-conversion-warning-win32-powl.patch patch -p1 -i ${srcdir}/0007-rbinstall-destdir.patch diff --git a/recipes/compile/ruby-2.4.1/0005-utf-8-default-encoding.patch b/recipes/compile/ruby-2.4.1/0005-utf-8-default-encoding.patch deleted file mode 100644 index 9a05095eb..000000000 --- a/recipes/compile/ruby-2.4.1/0005-utf-8-default-encoding.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/ruby.c b/ruby.c -index 3f89bb4..a46aea3 100644 ---- a/ruby.c -+++ b/ruby.c -@@ -1553,7 +1553,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) - enc = rb_enc_from_index(opt->ext.enc.index); - } - else { -- enc = lenc; -+ enc = rb_utf8_encoding(); - } - rb_enc_set_default_external(rb_enc_from_encoding(enc)); - if (opt->intern.enc.index >= 0) { -@@ -1659,7 +1659,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) - enc = rb_enc_from_index(opt->ext.enc.index); - } - else { -- enc = lenc; -+ enc = rb_utf8_encoding(); - } - rb_enc_set_default_external(rb_enc_from_encoding(enc)); - if (opt->intern.enc.index >= 0) { diff --git a/recipes/compile/ruby-2.4.1/PKGBUILD.erb b/recipes/compile/ruby-2.4.1/PKGBUILD.erb index a9ce35a7a..d2af08ab3 100644 --- a/recipes/compile/ruby-2.4.1/PKGBUILD.erb +++ b/recipes/compile/ruby-2.4.1/PKGBUILD.erb @@ -18,7 +18,6 @@ options=('staticlibs' 'strip') source=("https://cache.ruby-lang.org/pub/ruby/${pkgver%.*}/${_realname}-${pkgver}.tar.bz2" 0002-use-gnu-printf.patch 0004-exclude-changelog-from-rdoc.patch - 0005-utf-8-default-encoding.patch 0006-fix-conversion-warning-win32-powl.patch ruby.ico rubyw.ico) @@ -28,7 +27,6 @@ source=("https://cache.ruby-lang.org/pub/ruby/${pkgver%.*}/${_realname}-${pkgver sha256sums=('ccfb2d0a61e2a9c374d51e099b0d833b09241ee78fc17e1fe38e3b282160237c' '578bd0830fe96efc7656c732ec46b0658fc436a7a30d8945cf3b8240797809f0' '389236bdca5f283adde9b4b56febcfc25e228716e06a0edc21ea8fd7f27b75fa' - '339538b8b06feaf54de525dcae3c11ee548a1fb97fbe0ad319019027d6d19044' 'e7f83bc6e3b7ddadb5e3b14aa7d3a4e30eb97aea02df38796ca78714ad20e9b7' '6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22' 'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a') @@ -37,7 +35,6 @@ prepare() { cd ${srcdir}/${_realname}-${pkgver} patch -p1 -i ${srcdir}/0002-use-gnu-printf.patch patch -p1 -i ${srcdir}/0004-exclude-changelog-from-rdoc.patch - patch -p1 -i ${srcdir}/0005-utf-8-default-encoding.patch patch -p1 -i ${srcdir}/0006-fix-conversion-warning-win32-powl.patch autoreconf -fi diff --git a/test/test_encoding.rb b/test/test_encoding.rb index 2fcdb0b49..5ef6a715e 100644 --- a/test/test_encoding.rb +++ b/test/test_encoding.rb @@ -2,7 +2,7 @@ class TestEncoding < Minitest::Test def test_default_external - assert_equal Encoding::UTF_8, Encoding.default_external + assert_equal Encoding.find("locale"), Encoding.default_external end def test_default_internal @@ -10,7 +10,7 @@ def test_default_internal end def test_default_external_file_read - content = File.read(__FILE__) + content = File.read(__FILE__, encoding: __ENCODING__) assert_equal Encoding::UTF_8, content.encoding assert_match(/ÄöüßЖ/, content) end