extracted _fsencode helper, not changing original
encoded sndfile error messages and text tags