In StreamingParser.writeHeader()
method in two places here and here there are references to RFC5987 which allows utf-8 encoded string for header values.
There is no way to make utf8 strings RFC5987 compliant unless we parse header values into parameter pairs, checking which parameter in header value is using non-ascii character, creating title*
field out of value and reencode header value. But my implementation creates RFC5987-compliant headers in first place, which I think would improve performance considerably.
Having a shared implementation for typed header values keeps room for optimizations. Any optimization in this layer will benefit all frameworks built atop of this one. We can even cache typed header values in future if necessary.