testñtest encode iso-8859-1 test xf1test testяtest encode iso-8859-1 T

1
2
3
4
5
6
>>> u'testñtest'.encode('iso-8859-1')
'test\xf1test'
>>> u'testяtest'.encode('iso-8859-1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u044f' in position 4: ordinal not in range(256)