logo       

Re: ruby 1.8.6 puts outputs \000 chars: msg#02310

ruby-talk

Subject: Re: ruby 1.8.6 puts outputs \000 chars

On Jul 30, 2009, at 11:35 AM, John wrote:

I recently updated my gem library, now a simple program outputs \000
chars.
What has changed and is causing the \000 after each char output ?
And how to correct the problem.

Thanks for the help.

----- Snippet of input file:
aalib-ruby (0.7.1)
Author: Patrick Mahoney
Homepage: http://aalib-ruby.rubyforge.org/

----- lister.rb program

t= IO.readlines("gems2.txt")
puts "hello".inspect
puts t[0].inspect #print 1st line of file

--- output from lister.rb

C:\Users\spanton\Documents\GemList>ruby lister.rb
"hello"
"a\000a\000l\000i\000b\000-\000r\000u\000b\000y\000 \000
(\0000\000.\0007\000.\00
01\000)\000\r\000\n"


Is the file system using UTF-16 perhaps?

-Rob

Rob Biedenharn http://agileconsultingllc.com
Rob@xxxxxxxxxxxxxxxxxxxxxx



Google Custom Search

News | Mail Home | sitemap | FAQ | advertise