Set locale for tests that rely on it explicitly

Otherwise they will fail if locale is not UTF-8.

Thanks to Hendrik Jaeger (a.k.a. henk).
Merge branch 'set-locale-in-tests'