# Quirks with \\0 in double quotes

**URL:** <https://www.ruby-forum.com/t/quirks-with-0-in-double-quotes/55130>\
**Category:** Ruby\
**Created:** [March 17, 2006, 6:24am UTC](https://www.ruby-forum.com/t/quirks-with-0-in-double-quotes/55130 "2006-03-17T06:24:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Post date:** [March 17, 2006, 6:24am UTC](https://www.ruby-forum.com/t/quirks-with-0-in-double-quotes/55130/1 "2006-03-17T06:24:17Z")

</div>

Are these bugs? This is ruby-1.8.4. The YAML spec seems to say “\0” is  
legit.

* * *

require ‘yaml’

m = YAML.load(\<\<END)  
a: 4  
b: “\0\0”  
c: 5  
END

p m  
puts

m = YAML.load(\<\<END)  
a: 4

# b: “\0\0\0\0\0\0\0\0\0\0\0\0\0”

b: 6  
c: 5  
END

p m  
puts

begin  
m = YAML.load(\<\<END)  
a: 4  
b: “\0”  
c: 5  
END  
rescue =\> ex  
p ex  
puts ex.backtrace  
end

**END**

Output:

{“a”=\>4, “b”=\>""}

{“a”=\>4}

#\<ArgumentError: syntax error on line 3, col 1: `'> /usr/local/lib/ruby/1.8/yaml.rb:133:in`load’  
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load’  
-:23
