Exemple
Configure fallback handling and validation bounds for unmapped characters and undefined byte sequences in CodePage
sha256:e790c49d1fb497727a63db0bd94d5804512cbd6739117627ea6133dbbbd06ad9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Preuves d'exécution
L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.
Base de preuveContrat signé réussi
Reçus de vérification1
Niveau de vérificationL3_CONTRACT_PASS
Environnement déclaré
- Contexte d'exécution
- dart
- Système d'exploitation
- linux
- Architecture
- x64
- Runtime
- dart
- Langage
- dart
- Gestionnaire de paquets
- pub
Environnements des exécutions de vérification
- Contexte d'exécution
- dart 3
- Système d'exploitation
- linux debian · glibc
- Architecture
- x64
- Runtime
- dart 3
- Langage
- dart
- Gestionnaire de paquets
- pub
- Exécution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17
Cas
- Objectif
- Configure fallback handling and validation bounds for unmapped characters and undefined byte sequences in CodePage HOW
- Paquets
-
convert 3.1.2
- Environnement
- dart
- Créé
- 2026-08-17T13:02:57Z
Ce que l'on suppose souvent
CodePage.encode and CodePage.decode silently replace unmapped characters or undefined bytes with fallback tokens rather than throwing FormatException.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- CodePage.encode throws FormatException on unmapped characters unless configured with an in-range invalidCharacter byte, and CodePage.decode throws FormatException on undefined byte entries unless allowInvalid is set to true.
- latin2.encode('Price: 10€') throws FormatException because the Euro symbol is unmapped in ISO-8859-2.
- latin2.encode('Price: 10€', invalidCharacter: 0x3F) succeeds and substitutes the question mark byte 0x3F for the unmapped Euro character.
- latin2.encode('Price: 10€', invalidCharacter: 256) throws RangeError because invalidCharacter must be an integer within 0..255.
- latin2.decode([0x50, 0x80, 0x51]) throws FormatException because 0x80 is an undefined code point in ISO-8859-2.
- latin2.decode([0x50, 0x80, 0x51], allowInvalid: true) succeeds and emits Unicode replacement character U+FFFD for 0x80.
- latin2.decode([256]) throws FormatException with 'Not a byte value' while allowInvalid: true emits U+FFFD.
- CodePage('custom', 'ABC') throws ArgumentError because CodePage table definitions require exactly 256 characters.
Fichiers
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Télécharger l’artefact source (tar.gz)
Seeder d'origine
csx-seed
Reçus de vérification
- dart 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17 · ed25519:d91480838ac982c9