Follow-up from "Fix Changelog error on Non-encoded Commit Trailers"
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=472656) </details> <!--IssueSummary end--> The following discussion from !158191 should be addressed: - [ ] @stanhu started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158191#note_1996187503): (+2 comments) > I wonder if we should use `encode_utf8_no_detect` instead to get more deterministic output. `encode!` tries to detect the encoding, but from a short trailer it may not be able to determine the encoding. > > I see the added test only tries to convert some ASCII-8BIT value, but we ought to consider what happens if someone uses a completely different encoding. `encode!` might add `--broken encoding` to the trailer: https://gitlab.com/gitlab-org/gitlab/-/blob/23fe84143c7a235d3feca0d4da8bffa313f1f569/lib/gitlab/encoding_helper.rb#L21-41
issue