镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix: Strip UTF-8 BOM from resources to prevent corruption in XML and properties files - #1637

Merged
d3xter666 merged 3 commits into
mainfrom
fix-bom-encodding
Oct 6, 2026
Merged

d3xter666 merged 3 commits into
mainfrom
fix-bom-encodding

Conversation

@d3xter666

@d3xter666 d3xter666 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

JIRA: CPOUI5FOUNDATION-1364
Resolves: #1601

Additionally JSON & HTML files saved with UTF-8 BOM were fixed, too

@d3xter666 d3xter666 changed the title fix: Strip UTF-8 BOM from resources to prevent corruption in XML and … fix: Strip UTF-8 BOM from resources to prevent corruption in XML and properties files Oct 5, 2026
@d3xter666
d3xter666 force-pushed the fix-bom-encodding branch 3 times, most recently from 066b285 to 3cb582d Compare October 5, 2026 12:07
@d3xter666
d3xter666 requested a review from a team October 5, 2026 12:17
@d3xter666

d3xter666 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member Author

The return values of _calcMinSize in packages/builder/lib/lbt/bundle/AutoSplitter.js are now consistent: every branch returns a character count (String.length), matching how BundleWriter measures the generated bundle. Previously the method mixed byte counts (Buffer.length) and character counts across its branches. See b9c76d7.

This is a minor cleanup rather than a bug fix. _calcMinSize only produces an approximate size that is used to balance modules across split bundles, so a few characters more or less has no functional impact. I noticed the inconsistency while implementing the BOM stripping and decided to align it.

If the mixed units were intentional for some reason, let me know and I'll drop this part.

@matz3 matz3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remark about AutoSplitter.js changes. Everything else LGTM.

Comment thread packages/builder/lib/lbt/bundle/AutoSplitter.js Outdated
@d3xter666
d3xter666 requested a review from matz3 October 6, 2026 07:11
@matz3
matz3 requested a review from RandomByte October 6, 2026 12:25
@d3xter666
d3xter666 merged commit 3538552 into main Oct 6, 2026
77 checks passed
@d3xter666
d3xter666 deleted the fix-bom-encodding branch October 6, 2026 13:22
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.

Chromium 153+: UTF-8 BOM kept by @ui5/builder in bundles breaks apps

3 participants