What it means
The rule searches the whole file for an attribute called characterSetCode. In UBL it can be added to an element that holds a file, such as an attachment, to say which character set the content uses. EN 16931 does not use it, so it should not appear anywhere in the invoice. The rule has no business term number because it is about how the XML is written, not about a field you fill in.
Why it matters
EN 16931 says you should leave the characterSetCode attribute out of UBL invoices and credit notes.
How to fix it
You normally do not set this attribute yourself. Your invoicing software adds it when it writes the file, so look for an export setting or a newer version, or ask the software supplier to stop writing it. If you build the XML yourself, search the file for characterSetCode and delete the attribute, typically from cbc:EmbeddedDocumentBinaryObject, then check the file again. It is worth fixing the next time you change your export, and sooner if a recipient asks for a file without warnings.
Once the file is corrected, check it again for free: Validate an invoice against EN 16931
Or fix the invoice in a form and download the corrected file, for 1 credit: Fix a rejected e-invoice
The rule as published
CharacterSetCode attribute should not be present Where this rule applies
| Rule set | Version |
|---|---|
| EN 16931 (UBL) | 1.3.17 |
| EN 16931 (UBL credit note) | 1.3.17 |
| XRechnung 3.0 (UBL) | 3.0.2 |
| XRechnung 3.0 (UBL credit note) | 3.0.2 |
| Peppol BIS Billing 3.0 (invoice) | 2026.5 |
| Peppol BIS Billing 3.0 (credit note) | 2026.5 |
| SI-UBL 2.0 / NLCIUS (invoice) | 2.0.3.13 |
| SI-UBL 2.0 / NLCIUS (credit note) | 2.0.3.13 |
| France CTC (UBL invoice) | 1.4.0-04 |
| France CTC (UBL credit note) | 1.4.0-04 |
| CIUS-RO UBL Invoice 1.0.9 | 1.0.9 |
| CIUS-RO UBL Credit Note 1.0.9 | 1.0.9 |
Check your file
Drop your e-invoice to see whether UBL-DT-25 still fails, and which other rules do.
Related rules
- UBL-DT-26 Leave the encodingCode attribute out of the invoice
- UBL-DT-27 Leave the schemeAgencyID attribute out of the invoice
- UBL-DT-28 Leave the listAgencyID attribute out of the invoice
- UBL-DT-24 Leave out the currencyCodeListVersionID attribute
- UBL-DT-23 Leave out the uri attribute
- UBL-DT-22 Leave out the languageLocaleID attribute