title: Converting unicode fields into texts
body: <p>I have a shapefile (.shp) with field names wriiten in Japanese language. I wanted to read the field names in Japanese language using the program below:</p>
  
  <pre><code>import ogr
  infile = r"E:\shp\test.shp"
  ds = ogr.Open(infile,0); slayer = ds.GetLayer(0)
  fieldNames = [slayer.GetLayerDefn().GetFieldDefn(i).GetName() for i in range(0,slayer.GetLayerDefn().GetFieldCount())]
  
  for x in fieldNames:
      print x
  </code></pre>
  
  <p>But, it printed out as follows, which is not readable.</p>
  
  <pre><code>ﾂwﾍW
  ﾂxﾍW
  ’c’n–¼
  </code></pre>
  
  <p>How can I get readabe Japanese text for the field names?</p>
  
  <p>I also tried as <code>x.decode('utf8')</code>, but got error message <code>UnicodeDecodeError: 'utf8' codec can't decode byte 0x95 in position 0: invalid start byte</code></p>
  
  <p>How to do it guys?</p>