Skip to content

[CP] ContentType with utf-8 not encoded properly in Dart 3.6 #59813

@brianquinlan

Description

@brianquinlan

Commit(s) to merge

https://dart-review.googlesource.com/c/sdk/+/402281

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/402422

Issue Description

HttpResponse.writeln does not honor the charset set by the developer. This is a regression from Dart 3.5.

What is the fix

Change the IOSink writeln method to delegate to its subclass' write method.

Why cherry-pick

The issue was found by a user. Any user using HttpServer with an explicit "Content-Type" and sending non-ISO-8859-1 (Latin-1) data might be affected.

Risk

Low.

The code change is a single line (that reverts a change made in another PR). The change includes 230 lines of tests that also pass in Dart 3.5 (but not in Dart 3.6).

Issue link(s)

#59719

Extra Info

No response

Metadata

Metadata

Labels

area-sdkUse area-sdk for general purpose SDK issues (packaging, distribution, …).cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-mergedCherry-pick has been merged to the stable or beta branch.cherry-pick-reviewIssue that need cherry pick triage to approvetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions