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,289
  • 3
  • 20
  • 42

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
  • 2,930
  • 1
  • 17
  • 28
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
  • 78
  • 8