Skip to content

fix: strip UTF-8 BOM when loading properties - #87

Merged
magiconair merged 1 commit into
magiconair:mainfrom
sonnemusk:fix/strip-utf8-bom
Jul 23, 2026
Merged

fix: strip UTF-8 BOM when loading properties#87
magiconair merged 1 commit into
magiconair:mainfrom
sonnemusk:fix/strip-utf8-bom

Conversation

@sonnemusk

Copy link
Copy Markdown
Contributor

Summary

.properties files saved from some Windows editors start with a UTF-8 BOM. The first key was then stored as "\ufeffa" instead of "a", so normal lookups failed.

Strip a leading BOM in loadBytes for UTF-8 encodings.

Test plan

  • go test -run TestLoad
  • New tests for Load / LoadString with BOM-prefixed input

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants