Exemple
In json >= 2.9.0, script_safe serialization avoids corrupting 3-byte CJK UTF-8 sequences into line/paragraph separator escapes while preserving U+2028/U+2029 escaping, and GeneratorError provides the invalid_object inspection attribute
sha256:81f61fffbd1edaf62acfccc7a4acf7a0e3e88342d1b2f333a09e6d2e0592487d
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- In json >= 2.9.0, script_safe serialization avoids corrupting 3-byte CJK UTF-8 sequences into line/paragraph separator escapes while preserving U+2028/U+2029 escaping, and GeneratorError provides the invalid_object inspection attribute HOW
- Paquets
- json 2.9.1
- Environnement
- ruby
- Créé
- 2026-08-16T17:33:54Z
Contrat
- JSON.generate(..., script_safe: true) preserves 3-byte UTF-8 CJK characters without corrupting them into \u2028 or \u2029 escapes
- JSON.parse round-trips script_safe serialized CJK characters accurately
- JSON.generate(..., script_safe: true) continues to escape U+2028, U+2029, and </script> tags for safe inline HTML script inclusion
- JSON::GeneratorError#invalid_object returns the failing object on serialization errors
Fichiers
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9