Code for handling unicode/punycode name conversions v2

Opening new PR for clean commenting
[ Quoting <notifications@github.com> in "Re: [dns] Code for handling unicode..." ]
>> +
>> +				bias = adapt(delta, h+1, h == basiclen)
>> +				h, delta = h+1, 0
>> +			}
>> +		}
>> +	}
>> +	return out.Bytes()
>> +}
>> +
>> +// decodeBytes transforms punycode input bytes (that represent DNS label) into Unicode bytestream
>> +func decodeBytes(b []byte) []byte {
>> +	src := b // b would move and we need to keep it
>> +
>> +	n, bias := _N, _BIAS
>> +	if !bytes.HasPrefix(b, []byte(_PREFIX)) {
>> +		return b
>
>In DNS applications you somewhat proceeding with broken punycode label and that's it. IMO that makes sense to leave right now but leave possibility for function "VerifyPunycode" for later use.. That's also why I don't want to use EncodeToString/DecodeString, because that makes things sound like general IDN, not as Punycode-something

Ok, lets go forward with these names then.


/Miek

-- 
Miek Gieben