Below is an example of simple ESS script which loads any file as binary, an converts any byte, which has most signficant bit set, into C hex-escaped character. Other bytes get copied to output stream without changes.
It means, that if we feed non-BOM utf-8 file to this script, an output will be fully single-byte-compatible.

In addition, you may want to execute this script from command line using ess-console executable, for instance, the following batch will d othe job: