Add "encoding" configuration. (3rd version)

Encoding of input files should be determined by site settings (configuration).

Currently, it is determined by OS or environment settings implicitly.
This patch make it configurable.

(This request is revised version of #1365, #1366)