title: Python dict to YAML text doesn't preserve characters
body: <p>The question is simple but a bit tricky to phrase correctly.</p>
  
  <p>Basically, I have a dictionary that has the following data:</p>
  
  <pre><code>x = { foo: [1, '\n', 'bar'] }
  </code></pre>
  
  <p>When I convert to yaml using pyyaml with <code>yaml.safe_dump(x, default_flow_style=False)</code> I expect the output to be:</p>
  
  <pre><code>foo:
    - 1
    - '\n'
    - bar
  </code></pre>
  
  <p>however, I'm getting something like</p>
  
  <pre><code>foo:
    - 1
    - '
  
      '
    - bar
  </code></pre>
  
  <p>The newline character is actually being interpreted instead of being passed as the '\n' string. </p>
  
  <p>I have been looking at the pyyaml documentation but haven't seen the right incantations to have this thing parse correctly.</p>
  
  <p>Has anyone dealt with this same issue before? How did you solve it?</p>
  
  <hr>
  
  <p>To give more context, about this.</p>
  
  <p>I have a json I want to convert to yaml.</p>
  
  <p>The file that has something like this:</p>
  
  <pre><code>{ 
    "content": {
      "Fn::Join": ["\n", [{ "Ref": "parentStackName" }, ""]]
    }
  }
  </code></pre>
  
  <p>the end result should be this:</p>
  
  <pre><code>content:
    Fn::Join:
      - "\n"
      - - Ref: parentStackId
        - ''
  </code></pre>
  
  <p>notice the <code>"\n"</code> is just a string there, and not an actual character.</p>
  
  <p>The procedure I'm using is: </p>
  
  <ol>
  <li>Open file</li>
  <li>Parse json from text to dict</li>
  <li>Use dict to dump to yaml</li>
  </ol>
  
  <p>When I create the dict, you can see the "\n" as part of the string. It's when pyyaml dumps that into yaml that things go awry. </p>