Readlines help

B

Bucco

I am using the latest version of Ruby on Windows. When I do the
following in irb:

File.open('sometextfile.txt').readlines

I get an array of unicode characters. The example in the book I am
following along with, Everyday Scripting with Ruby, shows each array
element as a line from the file. No Unicode. How do I get readlines
to work without spitting out unicode?

Thanks,
SA
 
A

Augie De Blieck Jr.

I have a feeling it'll be a Windows irb configuration issue. I just
tried it on my Windows box and everything parses fine.

Unless your text file isn't plain ASCII, perhaps? Have you tried a
different text file?

-Augie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top