File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Sources/PureSwiftJSONParsing Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,11 @@ public struct DocumentReader {
219
219
case 48 ... 57 :
220
220
return ascii - 48
221
221
case 65 ... 70 :
222
+ // uppercase letters
222
223
return ascii - 55
224
+ case 97 ... 102 :
225
+ // lowercase letters
226
+ return ascii - 87
223
227
default :
224
228
return nil
225
229
}
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ class StringParserTests: XCTestCase {
28
28
XCTAssertNoThrow ( result = try JSONParser ( ) . parse ( bytes: [ UInt8] ( #""\u005A""# . utf8) ) )
29
29
XCTAssertEqual ( result, . string( " Z " ) )
30
30
}
31
+
32
+ func testSimpleLowercaseEscapedUnicode( ) {
33
+ var result : JSONValue ?
34
+ XCTAssertNoThrow ( result = try JSONParser ( ) . parse ( bytes: [ UInt8] ( #""\u003c""# . utf8) ) )
35
+ XCTAssertEqual ( result, . string( " < " ) )
36
+ }
31
37
32
38
func test12CharacterSequenceUnicode( ) {
33
39
// from: https://en.wikipedia.org/wiki/UTF-16#Examples
You can’t perform that action at this time.
0 commit comments