Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8877387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:27:24+00:00 2026-06-14T19:27:24+00:00

The following program works well with ruby but gives me a problem with JRuby

  • 0

The following program works well with ruby but gives me a problem with JRuby when reaching a file with a special character like the one I am using for testing, called “mão.txt”:

# coding: utf-8

puts "(A) #{__ENCODING__}"

puts "(B)" + "".encoding.to_s
puts "(C)" + String.new.encoding.to_s

Dir.glob("./fixtures/*").each do |f|
    puts "(D)" + f.encoding.to_s + "  " + f
    File.open(f)
    g = File.expand_path(f)
    puts "(E)" + g + " " + g.encoding.to_s
    File.open(g)
end

The result with JRuby is:

(A) UTF-8
(B)UTF-8
(C)ASCII-8BIT
(D)ASCII-8BIT  ./fixtures/mão.txt~
Errno::ENOENT: No such file or directory - ./fixtures/mão.txt~
  initialize at org/jruby/RubyFile.java:315
        open at org/jruby/RubyIO.java:1176
      (root) at encoding.rb:10
        each at org/jruby/RubyArray.java:1612
      (root) at encoding.rb:8

I am using Ubuntu 12.10, JRuby 1.7.0 and java 1.7.0_09

I plan to have the application packaged with Warble, so I fear command line arguments are not an option.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:27:25+00:00Added an answer on June 14, 2026 at 7:27 pm

    This is a reported bug with Dir.glob.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Based on the following simple program the bitwise left shift operator works only for
I added following command to Sessions -> Startup program but it didn't work. I'm
In following program . I have one doubt. I have declared one global variable
This following scippet works well, and I have been using it across many projects.
I've created the jar file it works well when I enter java -jar file.jar
I've written a program that works perfectly well when installed on my development PC,
A program I've written that normally works well is now freaking out about Keys.D1
I created a really simple DirectX program to capture the screen. It works well
I've got a program that under Windows and .NET Framework 4 works perfectly well
I write a c program to crawl blogs. It works well until it meets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.