Unless otherwise specified, HTTP responses from Micronaut (Views) should declare that they are in UTF-8 in the Content-Type header.
Actual Behaviour
No encoding is specified, leaving the browser to guess, and sometimes it guesses wrong.
Steps To Reproduce
Make a view that includes the output of something like DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).format(LocalDateTime.now()) which should yield a unicode NNBSP character before the "AM" or "PM" part.
Expected Behavior
Unless otherwise specified, HTTP responses from Micronaut (Views) should declare that they are in UTF-8 in the
Content-Type
header.Actual Behaviour
No encoding is specified, leaving the browser to guess, and sometimes it guesses wrong.
Steps To Reproduce
DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).format(LocalDateTime.now())
which should yield a unicode NNBSP character before the "AM" or "PM" part.<meta charset="utf-8"/>
tag to the header.Environment Information
macOS 14, Chrome
Example Application
No response
Version
4.3.6