fix typo (encode whole string and not only first byte)