About 42,000 results
Open links in new tab
  1. Get a list of all the encodings Python can encode to

    Nov 13, 2009 · I am writing a script that will try encoding bytes into many different encodings in Python 2.6. Is there some way to get a list of available encodings that I can iterate over? The …

  2. 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 …

  3. python - string encoding and decoding? - Stack Overflow

    Oct 15, 2019 · @rogueprocess By your description, Python has it right. A str is really a byte sequence (in Python 2.x). You decode a UTF-8 byte sequence into a Unicode string, and you …

  4. Python 3 - Encode/Decode vs Bytes/Str - Stack Overflow

    I repeat: Encode () returns an 8-bit string both under Python 2 and Python 3. It's called "str" in Python 2 and "bytes" in Python 3, but both are 8-bit strings.

  5. Decoding UTF-8 strings in Python - Stack Overflow

    Feb 15, 2018 · I'm writing a web crawler in python, and it involves taking headlines from websites. One of the headlines should've read : And the Hip's coming, too But instead it said: And the …

  6. URL decode UTF-8 in Python - Stack Overflow

    May 15, 2013 · In the general case, the tail of a URL is just a cookie. You can't know which local character-set encoding the server uses or even whether the URL encodes a string or …

  7. How do I perform HTML decoding/encoding using Python/Django?

    Nov 9, 2008 · From the Python docs: "Deprecated since version 3.2: This function is unsafe because quote is false by default, and therefore deprecated. Use html.escape () instead." As …

  8. What is the difference between encode/decode? - Stack Overflow

    Jan 15, 2009 · anUnicode. encode ('encoding') results in a string object and can be called on a unicode object aString. decode ('encoding') results in an unicode object and can be called on a …

  9. How do you decode Base64 data in Python? - Stack Overflow

    Jul 19, 2021 · I have the following piece of Base64 encoded data, and I want to use the Python Base64 module to extract information from it. It seems that module does not work. How can I …

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

    Jan 12, 2009 · 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 …

Refresh