Forum: Ruby YAML can not accept "\t" under windows!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
94af373d42084bf8b07f461291a910a3?d=identicon&s=25 capitain (Guest)
on 2005-12-08 08:17
(Received via mailing list)
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
?
Dce0999389d102f9a313af625375304c?d=identicon&s=25 dooby (Guest)
on 2005-12-08 10:23
(Received via mailing list)
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#id2525905

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


daz
C3274d0d109830f7f5121a7d8f7ead98?d=identicon&s=25 malte__ (Guest)
on 2005-12-08 10:40
(Received via mailing list)
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
94af373d42084bf8b07f461291a910a3?d=identicon&s=25 capitain (Guest)
on 2005-12-08 16:58
(Received via mailing list)
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? :((
94af373d42084bf8b07f461291a910a3?d=identicon&s=25 capitain (Guest)
on 2005-12-08 17:23
(Received via mailing list)
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....
93139b2c9893fd7dfafba4090db346c9?d=identicon&s=25 shot (Guest)
on 2005-12-08 18:33
(Received via mailing list)
Hello.

cap:

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

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

Cheers,
-- Shot
This topic is locked and can not be replied to.