Skip to content

[Docs D-28] Troubleshooting — Character encoding and invoice reference formatting #93

Description

@nielsdrost7

Wiki section: Troubleshooting
Tier: 4 — Troubleshooting
Publish when: InvoicePlane v1.8.0 is released
Related issues: #11 — BR-FR-02 invoice reference characters


XML encoding

All generated XML files use UTF-8 encoding. The XML declaration is:

InvoicePlane stores data in UTF-8, so accented characters (é, ä, ö, ñ, etc.) pass through cleanly. If you see garbled characters in the XML output, the database connection or client application is converting encoding incorrectly — the generator itself does not alter character encoding.


Special characters in XML values

The generators use DOMDocument to build XML, which escapes reserved characters automatically:

Character Escaped to
& &
< <
> >
" "
' '

You do not need to pre-escape these in InvoicePlane data entry.


Invoice number format rules

French Factur-X (BR-FR-02)

French rule BR-FR-02 restricts invoice identifiers to:

A-Z  a-z  0-9  +  -  _  /

Characters not allowed: . , @ # $ % ( ) [ ] space and all other punctuation.

InvoicePlane numbering scheme recommendations for France:

Pattern Valid? Example output
{YYYY}-{MM}-{NNNN} ✅ Yes 2026-06-0023
INV/{YYYY}/{NNNN} ✅ Yes INV/2026/0023
{YYYY}.{MM}.{NNNN} ❌ No (dot) 2026.06.0023
INV#000{NNNN} ❌ No (hash) INV#0000023

Configure the numbering scheme under Settings → Invoices → Invoice number format.

XRechnung

XRechnung has no special character restrictions on the invoice ID itself, but the Leitweg-ID (BT-10) must match the format provided by the contracting authority (typically digits and hyphens, e.g. 991-00001-06).

General

All formats inherit EN 16931's requirement that BT-1 (invoice number) is present and non-empty. Beyond that, character restrictions are format-specific.


Address fields with special characters

Company names and addresses with accented characters (Société, Müller GmbH, España S.L.) work correctly because DOMDocument handles UTF-8 natively. No special handling is needed.


Troubleshooting garbled output

If XML output contains garbled characters:

  1. Check your database character set: SHOW CREATE TABLE ip_invoices — should show utf8mb4
  2. Check the database connection character set: SHOW VARIABLES LIKE 'character_set%' — should all be utf8mb4
  3. Check the InvoicePlane database.php config: 'char_set' => 'utf8mb4'
  4. If the issue is only in specific fields, check whether those fields were imported from an external source with a different encoding

Migrated from InvoicePlane/InvoicePlane-e-invoices#52.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions