May be it will be simpler to accept https://bugs.ruby-lang.org/issues/8158 =
?
It has less memory requirement, avoids string comparisons, etc

(yes, i'm annoying a bit, sorry)


2013/3/29 h.shirosaki (Hiroshi Shirosaki) <h.shirosaki / gmail.com>

>
> Issue #8165 has been updated by h.shirosaki (Hiroshi Shirosaki).
>
> File 0001-load.c-fix-require-with-non-ascii-path.patch added
>
> One more issue seems string encoding.
> When looking up a feature name in rb_feature_p(), encoding information
> lacks.
> So `short_feature' should not have encoding.
> If encoding of the two non-ascii strings is different, hash value would b=
e
> different.
>
> load.c: rb_feature_p()
>
>     feature_val =3D rb_str_new(feature, len); // not have encoding
>
>     this_feature_index =3D rb_hash_lookup(features_index, feature_val);
>
>
> I've attached a patch. Tested on both trunk and 2.0.0 branch.
>
> ruby 2.1.0dev (2013-03-29 trunk 39991) [x86_64-linux]
> ruby 2.0.0p100 (2013-03-27 revision 39954) [x86_64-linux]
> ----------------------------------------
> Bug #8165: Problems with require
> https://bugs.ruby-lang.org/issues/8165#change-38028
>
> Author: Krugloff (Alexandr Kruglov)
> Status: Assigned
> Priority: Normal
> Assignee: tarui (Masaya Tarui)
> Category:
> Target version: current: 2.1.0
> ruby -v: ruby 2.0.0-p0
>
>
> Require doesn't work correctly if path contains cyrillic.
>
> require '/home/mak/test.rb' #-> true
> require '/home/mak/test.rb' #-> false
>
> require '/home/mak/=F0=D2=CF=C5=CB=D4=D9/test.rb' #-> true
> require '/home/mak/=F0=D2=CF=C5=CB=D4=D9/test.rb' #-> true
>
>
> --
> http://bugs.ruby-lang.org/
>
>