[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

YAML can not accept "\t" under windows!

cap

12/8/2005 7:08:00 AM

when i try this code
ruby -ryaml -e 'p YAML.load(" --- hello")'
it print the "hello"

but when i use
ruby -ryaml -e 'p YAML.load("\t--- hello")' under my windows
ruby 1.8.2 (2004-12-25) [i386-mswin32]
it print such error

e:/ruby/lib/ruby/1.8/yaml.rb:119:in `load': parse error on line 0, col
10: `' (ArgumentError)
from e:/ruby/lib/ruby/1.8/yaml.rb:119:in `load'
from -e:1

but it's ok under linux , so why yaml can not accept "\t" under windows
?

5 Answers

daz

12/8/2005 9:22:00 AM

0


cap wrote:
> when i try this code
> ruby -ryaml -e 'p YAML.load(" --- hello")'
> it print the "hello"
>
> but when i use
> ruby -ryaml -e 'p YAML.load("\t--- hello")' under my windows
> ruby 1.8.2 (2004-12-25) [i386-mswin32]
> it print such error
>

Which proves that if you try hard enough to break something,
you'll probably succeed.

Where in the specification does it say that should work?
http://yaml.org/spec/current.html...

It'll work on 1.8.4 but that doesn't make it part of the spec.


daz



Malte Milatz

12/8/2005 9:34:00 AM

0

cap:
> but it's ok under linux , so why yaml can not accept "\t" under windows ?

It doesn't under Linux either. YAML does not like tabs.

Malte

cap

12/8/2005 3:54:00 PM

0

I meet the same problem when using rubyonrails
the webrick produce strange
"Invalid char `\003' in expression"
error in the page when the rhtml file contains table character(use
TABLE to input a character using editplus or radrais)

has anyone met the same problem? :((

cap

12/8/2005 4:21:00 PM

0

5 min ago, I realized that the ruby version in my linux server is
1.8.3.
So I upgrade my windows ruby version to 1.8.3 ms-win32

Now ,the YAML can accept "\t" and the rails works very good :)

but i still doesn't know the reason....

Shot - Piotr Szotkowski

12/8/2005 5:32:00 PM

0

Hello.

cap:

> Now, the YAML can accept "\t" and the rails works very good :)
> but i still doesn't know the reason....

http://yaml.or... has one question only,
that question being 'Why does YAML forbid tabs?' :o)

Cheers,
-- Shot
--
I also fondly recall Paris because that's where I learned
to debug Zetalisp while drunk. -- Olin Shivers
====================== http://shot.pl/h... === http://shot... ===