This also fixes some test failures on Windows when the name of the build directory contains non-ascii characters.