[PATCH] D43165: [lit] Fix problem in how Python versions open files with different encodings

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 9 10:18:33 PST 2018


zturner added a comment.

How about this?  Open the file as text without specifying an encoding (this should use the default encoding).  If that fails, open the file as UTF-8.  If that fails, open the file as binary.

The approach in the ActiveState post doesn't handle UTF properly, but I think "either ASCII or UTF8" handles 99.99% of what types of encodings we want to treat as text.


Repository:
  rL LLVM

https://reviews.llvm.org/D43165





More information about the llvm-commits mailing list