coerce buffer to a string