Skip to content

Cannot instantiate String with Data with encoding nonLossyASCII #929

Closed
@Frizlab

Description

@Frizlab

The following code returns nil with Swift 6.0 and Swift 6.0-snapshot-2024-09-17 on Linux, but returns the proper String on macOS: String(data: Data(#"yolo"#.utf8), encoding: .nonLossyASCII).
I believe macOS is in the right.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions