Encoding:  Fix a few encoding problems with ctest.

This also fixes some test failures on Windows when the
name of the build directory contains non-ascii characters.
Merge topic 'encoding-ctest-fixes' into next

09b2ac38 Encoding:  Fix a few encoding problems with ctest.