0

I have an array like this

 Address=['fâch','Pyrénées']
    print(Address)

Here array has the special character.How can I solve this

error: utf8' codec can't decode byte 0xe1 in position 0: invalid continuation byte

Zakaria Shahed
  • 2,589
  • 6
  • 23
  • 52

2 Answers2

1

Just try this in python2.7 :

# -*- coding: utf-8 -*-
Address = ['fâch', 'Pyrénées']
for i in Address:
     print i

The commented line should be in top of the file.

Vikas Periyadath
  • 3,088
  • 1
  • 21
  • 33
0

You can use like this:

Address=['fâch','Pyrénées']
for i in Address:
    value = unicode(i, 'utf-8')
    print value

This should help.

taz
  • 76
  • 8