support for encoding taken from nearest compiler.

This is an attempt to pull the encoding and executable from the nearest compiler configuration (in a non-deprecated way).