Ensure errors.css is interpreted as UTF-8 encoding
Since https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/19096, we've inlined the `errors.css` by directly including the Sprockets assets into the HAML. This worked fine as long as the CSS file remained as a plain ASCII file. However, the switch to the new CSS pipeline with https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144479 appears to have introduced a single UTF-8 character. Since Sprockets loads the asset via `File.binread`, the contents of this UTF-8 file is forced as ASCII-8BIT. When this ASCII-8BIT string is combined with other UTF-8 characters, such as Chinese characters, the encoding fails with a 500 error: `incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)`. To work around this issue, we force the encoding to UTF-8 to ensure the error page can render. Relates to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17627 Changelog: fixed
想要评论请 注册 或 登录