title: How do I get YAML in Ruby as of 1.9.3 to dump ASCII-8Bit strings as strings?
body: <p>Here's the problem: I might have strings that are UTF-8, and I might have strings that are US-ASCII. Regardless of the encoding, I'd like YAML.dump(str) to actually dump <code>String</code> objects, instead of these useless <code>!binary</code> objects as the example shows.</p>
  
  <p>Is there a flag or something I'm not seeing to force YAML.dump() to do the right thing?</p>
  
  <p><strong>Ruby 1.9.1 example</strong></p>
  
  <pre class="lang-rb prettyprint-override"><code>YAML::VERSION              # "0.60"
  a = "foo"                  # =&gt; "foo"
  a.force_encoding("BINARY") # =&gt; "foo"
  YAML.dump(a)               # =&gt; "--- foo\n" 
  </code></pre>
  
  <p><strong>Ruby 1.9.3 example</strong></p>
  
  <pre class="lang-rb prettyprint-override"><code>YAML::VERSION              # "1.2.2"
  a = "foo"                  #  =&gt; "foo" 
  a.force_encoding("BINARY") #  =&gt; "foo" 
  YAML.dump(a)               # =&gt; "--- !binary |-\n  Zm9v\n"
  </code></pre>
  
  <p><strong>Update: Got my own answer</strong></p>
  
  <pre><code>YAML::ENGINE.yamler='syck'
  YAML.dump(a)               # =&gt; "--- foo\n" 
  </code></pre>
  
  <p>So, looks like using the old yamler engine with force the old behavior.</p>