fixes encoding exceptions for non-well encoded strings at dump