Text encoding when reading files
QuizMediumPython only
Which statements are true for Python 3.12? Pick all that apply.
- Without
encoding=,open()uses the locale's preferred encoding, which differs between machines - Reading Latin-1 bytes as UTF-8 can raise
UnicodeDecodeError - Passing
encoding="utf-8"makes the result the same on every machine - Python 3.12 always defaults to UTF-8 on every platform
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.