Skip to content

Conversation

@AZero13
Copy link
Contributor

@AZero13 AZero13 commented Jan 19, 2026

Also part of Apple's current libdispatch:

The UTF-8 to UTF-16 transformation was skipping BOM characters (0xFEFF) whenever they were encountered, regardless of their logical position in the data. This caused incorrect behavior when:

  • Data was split across multiple chunks in dispatch_data_apply callbacks
  • A BOM appeared in the middle of the data (offset > 0)

The bug occurred because the BOM skip check only examined the character value (wch == 0xfeff) without verifying it was at the logical start of the data.

… UTF-8 to UTF-16 in fragmented data scenarios.

Also part of Apple's current libdispatch:

The UTF-8 to UTF-16 transformation was skipping BOM characters (`0xFEFF`) whenever they were encountered, regardless of their logical position in the data. This caused incorrect behavior when:
- Data was split across multiple chunks in `dispatch_data_apply` callbacks
- A BOM appeared in the middle of the data (offset > 0)

The bug occurred because the BOM skip check only examined the character value (`wch == 0xfeff`) without verifying it was at the logical start of the data.
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.

1 participant