Improved encoding guessing for source files

For source files, rather than hardcoding the default encoding to latin1, it is better to use epp:default_encoding().