Formulator: fix FormToXML with a form encoding on py3

The test from 6316d9bb (Formulator: test form serialization with non
ascii elements, 2024-10-24) revealed that form with an encoding other
than UTF-8 are not supported.
6 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-Master

01:45:39

failed ERP5.PerformanceTest-Master

00:35:37

failed ERP5.UnitTest-Master

03:43:29

passed SlapOS.Eggs.UnitTest-Master.Python2

00:27:18

passed SlapOS.Eggs.UnitTest-Master.Python3

00:26:37

passed Wendelin.UnitTest-Master

00:32:31