Fixes crash due to a non-utf8 system encoding