title: Parsing unicode in tweets using python
body: <p>I've tried all manner of approaches to reading in this (sample) of tweets from this file. The unicode character <a href="http://www.fileformat.info/info/unicode/char/270c/index.htm" rel="nofollow">Victory Hand</a> does not seem to want to parse. Here's the data sample. </p>
  
  <pre><code>399491624029274112,Kyle aka K-LO,I unlocked 2 Xbox Live achievements in WWE 2K14! http://t.co/wRIxZTjYWg,False,0,Raptr,,,,,2013,11,10,11,0,0,0,0,1,0,0,0,0,0
  399491626584014848,Dots Group LLC,GeekWire Radio: Amazon vs. author  Xbox One first take  and favorite iPad apps - GeekWire http://t.co/jbbryoHpHe,False,0,IFTTT,,,,,2013,11,10,11,0,0,0,0,1,0,0,0,0,2
  399491630149169152,BETTINGGENIUS!,RT @xJohn69: Sergio Ramos giveaway!; XBOX + PS3; ; -RT; -Follow me and @NeillWagers; -S/Os appreciated; ; Goodluck http://t.co/D997faGSB5,False,0,Twitter for iPad,,,,,2013,11,10,11,0,1,1,0,1,0,0,0,0,2
  399491635735953408,Princess of TV,Toy Story of Terror is amaze balls. Thanks Xbox for the free NowTV #disneyweekend,False,0,Twitter for iPhone,,,,,2013,11,10,11,0,2,0,0,1,0,0,0,0,2
  399491654136369152,Sam Hambre,'9 Things You Should Know Before Buying a PlayStation 4'  http://t.co/Q3Ma1R83cF,False,0,Buffer,,,,,2013,11,10,11,0,7,0,1,0,0,0,0,0,0
  399491655780167680,Rhi ✌,@Escape2theMoon that's done what? im not on rn obvs i dont even have access to an xbox :c ?,False,0,web,399490703761223680,Escape2theMoon,1404625770,,2013,11,10,11,0,7,0,0,1,0,0,0,0,0
  </code></pre>
  
  <p>You can see the victory hand in the second field of the last tweet.</p>
  
  <p>What I want to do is build a long string from all of the tweets. Staring very simply, I cannot even process this script:</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf-8 -*-
  
  import codecs
  import csv
  
  current_file = codecs.open("C:/myfile.csv", encoding="utf-8")
  data = csv.reader(current_file, delimiter=",")
  
  tweets = ""
  
  for record in data:
      tweets = tweets + " " + record[2].encode('utf-8', errors='replace')
  </code></pre>
  
  <p>I've tried many permutations of importing, encoding, concatenating, converting to unicode, etc... but I cannot get past the victory hand. The error I always receive is:</p>
  
  <pre><code>UnicodeEncodeError                        Traceback (most recent call last)
  &lt;ipython-input-114-fd9b136abd74&gt; in &lt;module&gt;()
  ----&gt; 1 for record in data:
        2     tweets = tweets + ' ' + record[2].encode('utf-8', 'replace')
  
  UnicodeEncodeError: 'ascii' codec can't encode character u'\u270c' in position 23: ordinal not in range(128)
  </code></pre>
  
  <p>What am I doing wrong? How can I concatenate all of these tweets into a single string without unicode problems?</p>