punycode:encode/1 : refactor & handle oveflow and malformed error
punycode:encode/1 : refactor & handle oveflow and malformed error

refactor the code to be more readable when using the algorithm provided
by the spec. Also handle overflow like the decode function.

benoitc/erlang-idna