[dvsim] Enable round-trip of env variables into log
[dvsim] Enable round-trip of env variables into log

Environment variables are read by the dvsim tool and written back into a
log file. We define this log file as being UTF-8 encoded. The contents
of self.exports (read through os.environ()) are, however, locale-dependent.

Python retains the UTF-8 bytes it cannot decode in the system locale in
the string within a private Unicode coding space. This patch enables
writing them back into the log file.

An orthogonal (and desirable) fix is to change the CI runners to use
UTF-8 locales.

Signed-off-by: Philipp Wagner <5a4b10454c30419e54a1570be358a516ff84bb63@lowrisc.org>

lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan