Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6314] Swift will not deserialize a JSON object with unicode character FEFF as property name #4062

Open
swift-ci opened this issue Nov 7, 2017 · 1 comment

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 7, 2017

Previous ID SR-6314
Radar None
Original Reporter mark.probst (JIRA User)
Type Bug

Attachment: Download

Environment

Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)

Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, Codable
Assignee None
Priority Medium

md5: 3dc0fb1b6152165425ac5ac8aad629d6

Issue Description:

I'm trying to decode a JSON object that has a property whose name is the sole unicode character FEFF, which does not work. 200B works, for example. This is the type:

struct TopLevel: Codable {

{{ let empty: String}}

{{}}}

extension TopLevel {

{{ enum CodingKeys: String, CodingKey {}}

{{ case empty = "\u{feff}"}}

}

{{}}}

and this is the JSON:

{

{{ "\ufeff": "foo"}}

{{}}}

I've attached a test case. Compile it and invoke it with

./a.out blns-object.json

@belkadan
Copy link

belkadan commented Nov 7, 2017

I would guess it's being interpreted as a byte-order mark rather than as content. Hm.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants