bug fix: do not rely on platform default encoding