Python error accent

-7

Python is displaying a list of characters with a character error:

Normal List

19/01/2017  13:35       ARQUIVADO DEFINITIVAMENTE   
03/11/2016  10:55       EXPEDIÇÃO DE DESPACHO   
03/11/2016  10:52       CONCLUSOS PARA DESPACHO     
03/11/2016  10:52       EXPEDIÇÃO DE CERTIDÃO

List in python:

19/01/2017 13:35:00  ARQUIVADO DEFINITIVAMENTE
03/11/2016 10:55:00  EXPEDI\xc3\x87\xc3\x83O DE DESPACHO
03/11/2016 10:52:00  CONCLUSOS PARA DESPACHO
03/11/2016 10:52:00  EXPEDI\xc3\x87\xc3\x83O DE CERTID\xc3\x83O
    
asked by anonymous 28.08.2018 / 00:39

1 answer

0

The answer to this question is in this post: Error in accentuation in Python 2.7

But I will comment here too:

  • Your text editor must be configured to save the file in UTF-8 encoding.
  • No cmder:

    - - coding: utf-8 - -

    import os, sys

    os.system ('@ chcp 65001')

    print "OFFICE DELIVERY" print "dispatch dispatch

  • "

  • In the windows cmd, there is nothing you can do at the code level to solve this, Windows has a command called chcp, according to Google set to chp 65001 should resolve
  • 30.08.2018 / 16:07