Files
swift-nio/Sources
Adam FowlerandCory Benfield 74cf44e261 Add ByteBuffer methods getUTF8ValidatedString and readUTF8ValidatedString (#2973)
Add methods to ByteBuffer to read validated UTF8 strings

### Motivation:

The current `readString` and `getString` methods of `ByteBuffer` do not
verify that the string being read is valid UTF8. The Swift 6 standard
library comes with a new initialiser `String(validating:as:)`. This PR
adds alternative methods to ByteBuffer which uses this instead of
`String(decoding:as:)`.

### Modifications:

Added `ByteBuffer.getUTF8ValidatedString(at:length:)`
Added `ByteBuffer.readUTF8ValidatedString(length:)`

### Result:

You can read strings from a ByteBuffer and be certain they are valid
UTF8

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-11-21 17:44:42 +00:00
..
2024-01-16 03:30:26 -08:00
2024-09-12 13:18:25 +01:00
2024-09-12 13:18:25 +01:00