From: Run Paint Run Run Date: 2010-08-29T06:16:29+09:00 Subject: [ruby-core:31915] [Ruby 1.9-Bug#3758][Open] require Raises Encoding::CompatibilityError for Invalid, Non-ASCII Feature Names --mimepart_4c797caba908b_eed58fbc4a447 Content-Type: text/plain Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline Bug #3758: require Raises Encoding::CompatibilityError for Invalid, Non-A= SCII Feature Names http://redmine.ruby-lang.org/issues/show/3758 Author: Run Paint Run Run Status: Open, Priority: Low Category: lib ruby -v: ruby 1.9.3dev (2010-08-28 trunk 29127) [i686-linux] When trying to require a feature with a non-ASCII name that does not corr= espond to an installed gem or a file in $LOAD_PATH, this happens: run@paint:~/git/ruby =E2=86=92 ./ruby -e 'require "=E2=88=9E"' :33:in `end_with?': incompatible = character encodings: ASCII- 8BIT and UTF-8 (Encoding::CompatibilityError)= from :33:in `rescue in requ= ire' from :29:in `require' from -e:1:in `
' The attached is a simplistic fix, but it assumes both encodings are ASCII= -compatible; the elegant solution evades me. ---------------------------------------- http://redmine.ruby-lang.org --mimepart_4c797caba908b_eed58fbc4a447 Content-Type: text/x-patch; name=custom-require.rb.patch Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename=custom-require.rb.patch ZGlmZiAtLWdpdCBhL2xpYi9ydWJ5Z2Vtcy9jdXN0b21fcmVxdWlyZS5yYiBi L2xpYi9ydWJ5Z2Vtcy9jdXN0b21fcmVxdWlyZS5yYgppbmRleCA0ODBjYjdl Li5hZmFkYzk5IDEwMDY0NAotLS0gYS9saWIvcnVieWdlbXMvY3VzdG9tX3Jl cXVpcmUucmIKKysrIGIvbGliL3J1YnlnZW1zL2N1c3RvbV9yZXF1aXJlLnJi CkBAIC0yOCw3ICsyOCw4IEBAIG1vZHVsZSBLZXJuZWwKICAgZGVmIHJlcXVp cmUocGF0aCkgIyA6ZG9jOgogICAgIGdlbV9vcmlnaW5hbF9yZXF1aXJlIHBh dGgKICAgcmVzY3VlIExvYWRFcnJvciA9PiBsb2FkX2Vycm9yCi0gICAgaWYg bG9hZF9lcnJvci5tZXNzYWdlLmVuZF93aXRoPyhwYXRoKQorICAgIG1lc3Nh Z2UgPSBsb2FkX2Vycm9yLm1lc3NhZ2UKKyAgICBpZiBtZXNzYWdlLmVuZF93 aXRoPyhwYXRoLmZvcmNlX2VuY29kaW5nKG1lc3NhZ2UuZW5jb2RpbmcpKQog ICAgICAgaWYgR2VtLnRyeV9hY3RpdmF0ZShwYXRoKQogICAgICAgICByZXR1 cm4gZ2VtX29yaWdpbmFsX3JlcXVpcmUocGF0aCkKICAgICAgIGVuZAo= --mimepart_4c797caba908b_eed58fbc4a447--