Commit 6f6ccca
UnicodeUtil: Fix UTF8toUTF16WithFallback byte[] overload to use fallback path, #1024
The byte[]/offset/length overload was delegating to the throwing
UTF8toUTF16 variant, so callers like BytesRef.Utf8ToStringWithFallback()
would throw DecoderFallbackException on invalid UTF-8 instead of
substituting U+FFFD as the method name and docs promise. Delegate to
the ReadOnlySpan<byte> fallback overload and add a regression test
covering the 4-arg signature with a non-zero offset.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 60f4026 commit 6f6ccca
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
380 | 399 | | |
381 | 400 | | |
382 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
1068 | | - | |
| 1068 | + | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| |||
0 commit comments