Skip to content

Regression: String.data(using: .iso2022JP) unexpectedly returns nil on non-Darwin. #1014

Closed
@YOCKOW

Description

@YOCKOW

Given the following code:

import Foundation
print("Hello, world!".data(using: .iso2022JP) as Any)

Results are:

OS Swift Result
macOS 5.10 "Optional(13 bytes)"
Ubuntu 5.10 "Optional(13 bytes)"
macOS 6.0 "Optional(13 bytes)"
Ubuntu 6.0 "nil"

This is regression from Swift 6 on Linux.
Note that ISO-2022-JP is often used for MIME(Email) in Japan.

Relates to: #925

Metadata

Metadata

Assignees

No one assigned

    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