title: Unicode and UTF-8 encoding issue with Scrapy XPath selector text
body: <p>I'm using Scrapy and Python (as part of a Django project) to scrape a site with German content. I have <code>libxml2</code> installed as the backend for Scrapy selectors. </p>
  
  <p>If I extract the word <code>'Hüftsitz'</code> (this is how it is displayed on the site) through selectors, I get: <code>u'H\ufffd\ufffdftsitz'</code> (Scrapy XPath selectors return Unicode strings). </p>
  
  <p>If I encode this into <code>UTF-8</code>, I get: <code>'H\xef\xbf\xbd\xef\xbf\xbdftsitz'</code>. And if I print that, I get <code>'H??ftsitz'</code> which isn't correct. I am wondering why this may be happening.</p>
  
  <p>The <code>character-set</code> on the site is set to <code>UTF-8</code>. I am testing the above on a Python shell with <code>sys.getdefaultencoding</code> set to <code>UTF-8</code>. Using the Django application where the data from XPath selectors is written to a MySQL database with <code>UTF-8</code> character set, I see the same behaviour. </p>
  
  <p>Am I overlooking something obvious here? Any clues or help will be greatly appreciated.</p>