About 110,000 results
Open links in new tab
  1. Unicode (UTF-8) reading and writing to files in Python

    See the codecs module for the list of supported encodings. So by adding encoding='utf-8' as a parameter to the open function, the file reading and writing is all done as utf8 (which is also now the …

  2. python - Portuguese encoding ã, ê, ç, á - Stack Overflow

    Oct 11, 2018 · For instance, ã shows ã, ê shows ê, ç shows ç, á shows á, etc I have tried to change starting from encoding of notepad++ and within my python code using utf-8, latin-1, ISO …

  3. Correct way to define Python source code encoding

    I just wanted to add that Python 3 has changed the default encoding from ascii to UTF-8. Compare: python 2.7 docs with python 3.7 docs. This means you can safely omit this encoding if you wanted to …

  4. python - What encoding does open () use by default? - Stack Overflow

    encoding is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent (whatever locale.getpreferredencoding() returns), …

  5. Working with UTF-8 encoding in Python source - Stack Overflow

    Jun 9, 2011 · In Python 3, UTF-8 is the default source encoding (see PEP 3120), so Unicode characters can be used anywhere. In Python 2, you can declare in the source code header:

  6. Python default string encoding - Stack Overflow

    Apr 24, 2018 · When, where and how does Python implicitly apply encodings to strings or does implicit transcodings (conversions)? And what are those "default" (i.e., implied) encodings? For …

  7. python - How to determine the encoding of text - Stack Overflow

    I received some text that is encoded, but I don't know what charset was used. Is there a way to determine the encoding of a text file using Python? How can I detect the encoding/codepage of a text ...

  8. python - ImportError: No module named 'encodings' - Stack Overflow

    Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' I searched to figure out my problem. Solution was simple. When you install python3.5, …

  9. Python reading from a file and saving to utf-8 - Stack Overflow

    Here is what happened. The code provided by @MarkTolonen worked if I change iso-8859-15 instead of utf-8 when opening the file. However as my editor updated the file from memory having already …

  10. python - Encoding utf-8 permite acentos? - Stack Overflow em …

    Jun 5, 2015 · Se fizermos # encoding: utf-8 na primeira linha de um programa Python, conseguimos fazer acentos no código todo?