Skip to content

Only enable BOM encoding option on UTF encodings#8363

Merged
jekyllbot merged 1 commit intojekyll:masterfrom
LinuxMercedes:bom-nonsense
Apr 1, 2022
Merged

Only enable BOM encoding option on UTF encodings#8363
jekyllbot merged 1 commit intojekyll:masterfrom
LinuxMercedes:bom-nonsense

Conversation

@LinuxMercedes
Copy link
Copy Markdown
Contributor

This is a 🐛 bug fix.

Summary

Ruby does not allow the BOM option on non-UTF encodings, warning that it is "nonsense". To remove this warning, we change the BOM option check here to match how Ruby checks for compatible encodings.

Relevant bits from the Ruby source are the test and the utf_prefix string.

Context

Fixes #7972.

Ruby does not allow the BOM option on non-UTF encodings, warning that it
is "nonsense". To remove this warning, we change the BOM option check
here to match how Ruby checks for compatible encodings.

Relevant bits from the Ruby source are the test:
https://github.com/ruby/ruby/blob/ruby_2_7/io.c#L5693-L5699
and the `utf_prefix` string:
https://github.com/ruby/ruby/blob/ruby_2_7/io.c#L5454

Fixes jekyll#7972.
@DirtyF DirtyF requested a review from a team November 11, 2020 10:39
@DirtyF DirtyF added the fix label Nov 11, 2020
Copy link
Copy Markdown
Member

@ashmaroli ashmaroli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ashmaroli
Copy link
Copy Markdown
Member

Thanks @LinuxMercedes
@jekyllbot: merge +fix

@jekyllbot jekyllbot merged commit 2a0272c into jekyll:master Apr 1, 2022
@jekyllbot jekyllbot added the bug label Apr 1, 2022
jekyllbot added a commit that referenced this pull request Apr 1, 2022
github-actions bot pushed a commit that referenced this pull request Apr 1, 2022
lm: Only enable BOM encoding option on UTF encodings (#8363)

Merge pull request 8363
@jekyll jekyll locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warning: BOM with non-UTF encoding ISO-8859-1 is nonsense

4 participants