File.basename doesn't cope with UTF8 strings
--------------------------------------------

                 Key: JRUBY-3922
                 URL: http://jira.codehaus.org/browse/JRUBY-3922
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.3.1
         Environment: Solaris 10 U6
            Reporter: Ben Summers
         Attachments: basename.rb

The implementation of File.basename corrupts UTF8 strings which contain code 
points > 127.

$ ruby test/basename.rb 
"dir/a 
\342\274\210\343\200\211\343\200\203\343\200\204\342\250\266\342\206\226.pdf"
"a \342\274\210\343\200\211\343\200\203\343\200\204\342\250\266\342\206\226.pdf"
$ /opt/jruby/bin/jruby test/basename.rb 
"dir/a 
\342\274\210\343\200\211\343\200\203\343\200\204\342\250\266\342\206\226.pdf"
"a ??????????????????.pdf"

$ ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-solaris2.10]
$ /opt/jruby/bin/jruby --version        
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 
1.6.0_11) [x86-java]





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to