Use UTF-8; optionally read from cmd line path.

For Python script, set encoding on input and output file handles to UTF-8.
Also, if a path is specified on the command line, open it instead of reading
from stdin.