YAML can not accept "\t" under windows!

C

cap

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
?
 
D

daz

cap said:
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#id2525905

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


daz
 
C

cap

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? :((
 
C

cap

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....
 

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

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top