title: Why does this Unicode / UTF-8 "En Dash" character in my JSON feed get mangled when I download it?
body: <p>My JSON feed is here:</p>
  
  <p><a href="http://america.aljazeera.com/bin/ajam/api/story.json?path=/content/ajam/watch/shows/america-tonight/articles/2014/4/28/the-dark-side-oftheoilboomhumantraffickingintheheartland" rel="nofollow noreferrer">http://america.aljazeera.com/bin/ajam/api/story.json?path=/content/ajam/watch/shows/america-tonight/articles/2014/4/28/the-dark-side-oftheoilboomhumantraffickingintheheartland</a></p>
  
  <p>It is a JSON representation of this HTML page, you can see the same En Dash character in the subtitle of the page.</p>
  
  <p><a href="http://america.aljazeera.com/watch/shows/america-tonight/articles/2014/4/28/the-dark-side-oftheoilboomhumantraffickingintheheartland.html" rel="nofollow noreferrer">http://america.aljazeera.com/watch/shows/america-tonight/articles/2014/4/28/the-dark-side-oftheoilboomhumantraffickingintheheartland.html</a></p>
  
  <p>The En Dash is in the 2nd key (description):</p>
  
  <pre><code>description: "In a North Dakota town that was once dying, oil and money are flowing – and bringing big-city problems",
  </code></pre>
  
  <p>after the word "flowing".</p>
  
  <p>The page has the following HTTP header:</p>
  
  <pre><code>Content-Type: application/json;charset=UTF-8
  </code></pre>
  
  <p>which can be seen by requesting it via <code>curl -v</code> or <code>curl -I</code></p>
  
  <p>Downloading it in Ruby using HTTParty like so:</p>
  
  <pre><code>&gt; r = HTTParty.get('http://america.aljazeera.com/bin/ajam/api/story.json?path=/content/ajam/watch/shows/america-tonight/articles/2014/4/28/the-dark-side-oftheoilboomhumantraffickingintheheartland')
  &gt; r['description']
   =&gt; "In a North Dakota town that was once dying, oil and money are flowing –\u0080\u0093 and bringing big-city problems"
  </code></pre>
  
  <p>mangles it, as seen above. After much research I realized is a representation of the hex utf-8 unicode value as seen here:</p>
  
  <p><a href="http://www.fileformat.info/info/unicode/char/2013/index.htm" rel="nofollow noreferrer">http://www.fileformat.info/info/unicode/char/2013/index.htm</a></p>
  
  <p>specifically, this:</p>
  
  <pre><code>UTF-8 (hex) 0xE2 0x80 0x93 (e28093)
  </code></pre>
  
  <p>This data is later fed into an iPhone app and an Android app. On the the Android app it looks like the attached <img src="https://i.stack.imgur.com/mQW5K.png" alt="Android.png">. On an iPhone it looks fine - I think because only the first character is rendered and that is a regular Ascii dash, and the next two characters are skipped.</p>
  
  <p>Finally, downloading it in JavaScript using AJAX does seem to handle it correctly:</p>
  
  <pre><code>&gt; r = json['description'].match(/flowing (.*) and/)[1]
  &gt; "–"
  &gt; r
  &gt; "–"
  &gt; r.length
  &gt; 3
  &gt; r.toString(16)
  &gt; "–"
  </code></pre>
  
  <p>So...what is going on? What can I do to fix it? Is the fault with the server or with my code?</p>