Use 'utf-8' as default/fallback encoding.

- Also reorder stdlib imports alphabetically :)

[Closes #4427]