string/pack: avoid weird encoding errors