2 Replies Latest reply on Jul 30, 2010 3:32 PM by Vincent_L

    More on XML and special characters : code loss issue

    Vincent_L

      Summary

      Following my post about XML CF and special characters^M --------------------------------------------^M ^M ^M I just compared FMP 10 DDR output to FMP11^M ^M FMP 10^M ^M LeTexte=Substitute ( LeTexte ; "?" ; "¶" );// Remplace FF^M //LeTexte=ZapChars ( LeTexte ; "????????????????????????????" );Suprime Gremlins^M ^M FMP 11^M ^M LeTexte=Substitute ( LeTexte ; "^L" ; "¶" );// Remplace FF^M //LeTexte=ZapChars ( LeTexte ; "^B^C^D^E^G^H^H^K^L^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^]^_" );Suprime Gremlins^M ^M So FMP 10 converts those strange characters to ? to avoid any issue^M that's not perfect but that's smarter for the sake of DDR export.^M ^M Then I added a calculation field in my sample file, with the offending CF code in it, to see how calc fields were handled by FMP 11 engine for the DDR export.^M ^M FMP 11, for calc field, has the same behavior as 10, it replaces those characters by ?^M ^M SO FMP 11 XML HANDLING OF CF FUNCTION IS DIFFERENT THAN THE ONE IT USES FOR CALC FIELDS : BUUUGGGG !^M ^M But if FMP 10 ? behaviors is good for DDR export, it's bad nonetheless regarding tyhe copy and pasting feature of fields, cf or everything else. Because by converting those characters to ? it destroys information.^M ^M So a user can create a solution and have it beak just because he cut and paste something. So by legitimate uses of standard FMP feature he can introduces bugs just because FMP is buggy. That's VERY BAD. ^M ^M ^M It's perfectly possible to encode those characters to XML, and it seems this became necessary with the internal use of XML for copy pasting.^M ^M I also tried something else, you'd think that FMP would be able to export DATA in xml without problems. So I've cut and pasted the offending code in a text field. And exported it as XML : ERRO both in FMP 10 and FMP 11.^M ^M So EXPORTING DATA in xml can create bad XML files !^M ^M all the files of my discoveries are ready but can't be attached in that bad forum (though it will save time for everyone)