I have noticed that when using CiviSEPA to generate an XML file to be submitted to the bank for payment collection, no special characters get through. Some characters are converted into ASCII "equivalent" characters and some others into question marks ?.

I am using UTF-8 within CiviCRM. Also, the XML file generated starts with:

<?xml version="1.0" encoding="UTF-8"?>

So the XML file encoding seems to be capable of using UTF-8 characters. Some examples:

Name       | Turns into
---------- | ----------
Mónica     | Monica
Begoña     | Begona
Mª Dolores | M? Dolores

This seems to be a "feature" as some conversions seem to be getting the "closest" ASCII equivalent. But then the Transaction Message seems to be getting a worse treatment: La fundación le agradece su aportación turns into La fundaci??n le agradece su aportaci??n.

I have tried generating XML files mostly with the pain.008.001.02 PAIN version but it seems to be the same for the other PAIN versions.

So I would like to know whether the XML files may contain any UTF-8 characters (and the average bank will accept that). If this is so, do I have something wrong in the CiviCRM configuration? Is there a way to fix this?


I do recall having read the specification for sepa (don't judge me, I had to) that says:

  1. the xml file is utf8 encoded
  2. but can only contain ascii-7 characters

Did you try to upload the xml to your bank? I suppose they offer a test mode, you might want to try to check how it looks there

  • 1
    That explains why UTF8 characters are turned into ASCII equivalents. I will do some testing with the bank as you suggest. Also, I will try to locate the place in the PHP code where characters are transformed to make sure I add a few more mappings. If you happen to know the right file... And no judgement for reading the SEPA specs; I am grateful for it! Nov 14 '18 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.