Open robertbastian opened 5 years ago
Well played. Turnabout is fair play. :)
We could only add charset
implicitly if the mime-type is text/something
. However, some application/*
types may also allow a charset property, and we are not going to include a dictionary of which types allow which properties. So, that's not a viable solution
More likely, we'll just document that the fromString
will always include a charset header, and if you don't want that, you should use .fromBytes(encoding.encode(string))
instead of .fromString(string, encoding: encoding)
.
produces
However, the charset is pointless for this mime type (and others), and should not be set without the user explicitly asking for it. The dartdoc does not mention this behaviour: https://github.com/dart-lang/sdk/blob/master/sdk/lib/core/uri.dart#L299