json_mend 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/json_mend/parser.rb +3 -4
- data/lib/json_mend/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae2e6bb67d6227598226e35e852e4b4ae7f681e6ce8bcb94d11bd5e61c74a989
|
|
4
|
+
data.tar.gz: 0fbd0b9cc00caa626a794e2024d34d0f31d9bf407f31e7ce8cbb0e1b78c9773d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afd9daaec420a7bdb29ed2bf5d6438e5b335d2990eeae24503ab0fc10e6221a299dbcf63f4d0b09e093a7a03a523f5fa90db5ff46fc7cbec40670cac71f4955a
|
|
7
|
+
data.tar.gz: 730768fa1d1954c626c88c17b8afc3ec7e4726abcd2b4602072453e35d910da0cd6e1b92c5841e571abcd22c6bc7e02df65de7b8dfab45e9cd1210de24ca6f94
|
data/lib/json_mend/parser.rb
CHANGED
|
@@ -1330,12 +1330,11 @@ module JsonMend
|
|
|
1330
1330
|
# Handle the common 0-offset case
|
|
1331
1331
|
if offset.zero?
|
|
1332
1332
|
# peek(1) returns the next BYTE, not character
|
|
1333
|
-
|
|
1334
|
-
return nil
|
|
1333
|
+
byte_str = @scanner.peek(1)
|
|
1334
|
+
return nil if byte_str.empty?
|
|
1335
1335
|
|
|
1336
1336
|
# Fast path: If it's a standard ASCII char (0-127), return it directly.
|
|
1337
|
-
|
|
1338
|
-
return byte.chr(Encoding::UTF_8) if byte < 128
|
|
1337
|
+
return byte_str if byte_str.getbyte(0) < 128
|
|
1339
1338
|
|
|
1340
1339
|
# Slow path: If it's a multibyte char (e.g. “), use regex to match the full character.
|
|
1341
1340
|
return @scanner.check(/./m)
|
data/lib/json_mend/version.rb
CHANGED