Skip to content

Commit ce51c0d

Browse files
committed
comment
1 parent 6cebf0e commit ce51c0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Extensions/AzureBlobPayloads/Converters/LargePayloadDataConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public sealed class LargePayloadDataConverter(DataConverter innerConverter, IPay
2424
readonly DataConverter innerConverter = innerConverter ?? throw new ArgumentNullException(nameof(innerConverter));
2525
readonly IPayloadStore payLoadStore = payloadStore ?? throw new ArgumentNullException(nameof(payloadStore));
2626
readonly LargePayloadStorageOptions largePayloadStorageOptions = largePayloadStorageOptions ?? throw new ArgumentNullException(nameof(largePayloadStorageOptions));
27+
// Use UTF-8 without a BOM (encoderShouldEmitUTF8Identifier=false). JSON in UTF-8 should not include a
28+
// byte order mark per RFC 8259, and omitting it avoids hidden extra bytes that could skew the
29+
// externalization threshold calculation and prevents interop issues with strict JSON parsers.
30+
// A few legacy tools rely on a BOM for encoding detection, but modern JSON tooling assumes BOM-less UTF-8.
2731
readonly Encoding utf8 = new UTF8Encoding(false);
2832

2933
/// <summary>

0 commit comments

Comments
 (0)