python - If your source is ASCII, should you specify coding? -
we have large project entirely coded in ascii. worth putting coding statements @ beginning of each source file (e.g. #coding=utf-8) reason if source doesn't have unicode in it?
thanks, --peter
ascii default in python 2. utf-8 default in python 3.
if files ascii-only; don't need declare source code encoding in both version (ascii subset of utf-8).
non-ascii character leads syntaxerror in python 2 therefore accidental non-ascii character won't go unnoticed , won't corrupt data. there no reason declare source code encoding ascii-only files.
Comments
Post a Comment