lib/text: fix to|from_percent_encoding with unicode characters