Thanks for the quick response.
After digging through this for a bit, I think there just may be a lot of artifacts in here from years of code updates and specs changing.
then encodes it to utf-8 bytes (
It's just really interesting and seems to be all over. I'm familiar with most of the specs, so understand the ascii requirements for names, but it's just hard to decipher from scratch.
The thing that triggered me on this path, is this behavior:
The output of that is commonly used as cookie.
At this point I lose track of the next few steps.
It just seems very odd to me that there are so many conversions going on, without detailed documentation disclosing why.