encode non-UTF8 data as raw arrays of bytes, fixes cgrun037 (except on SpiderMonkey which is borked)