Hala Gamal wrote:
> my code works well with english file but when i use text file
> encodede"utf-8" "my file contain some arabic letters" it doesn't work. my
> code:
> with codecs.open("tt.txt",encoding='utf-8') as txtfile:
Try encoding="utf-8-sig" in the above to remove the byte order mark (BOM)
upon decoding, see
http://docs.python.org/2.7/library/codecs.html#module-encodings.utf_8_sig
That should prevent
> UnicodeEncodeError: 'decimal' codec can't encode character u'\ufeff' in
> position 0: invalid decimal Unicode string
--
http://mail.python.org/mailman/listinfo/python-list