Sometimes when I commit a file into source control (GitHub), I get a really strange result:
<?xml version="1.0" encoding="UTF-16"?>
㰀嘀匀堀䴀䰀㸀ഀഀ
㰀倀爀漀瀀攀爀琀礀 䴀甀氀琀椀嘀愀氀甀攀㴀∀ ∀ 渀愀洀攀㴀∀䔀渀挀爀礀瀀琀攀搀䔀搀椀琀倀愀猀猀眀漀爀搀∀ 琀礀瀀攀㴀∀猀琀爀椀渀最∀㸀㰀⼀倀爀漀瀀攀爀琀礀㸀ഀഀ
When I look at the file on GitHub, it looks ok:
https://raw.githubusercontent.com/Orcomp/Orchestra/develop/deployment/finalbuilder/Orchestra.CreatePackages.fbp7
Note that the files is used in combination with Continua CI, so might it have to do something with that? And since it is line-by-line, I thought of this:
If the loading of a document fails, try to load again, but remove ever n(2) line (thus 2,4,6,8, etc). That’s what I do manually to fix the problem.
I opened up the file in notepad++ (the one without strange characters, which was 250 kb). Then I changed the encoding to UTF-8 and also updated the encoding attribute in the header. That seems to work (the file got twice as small) and is working now.
Why do you save as UTF-16 by default?
UTF-16 is the default because the string types in Delphi and C# are UTF-16, means no encoding conversions when loading/saving. In FB8 the default will be UTF-8.
I have this issue sometimes:
@@log{message status=error, value=Error Loading Project File : Invalid at the top level of the document.
Line : 1
Char : 40 }
I just updated a file. Since the file is open-source, it should be fairly easy to check what’s wrong with this file?
https://github.com/WildGums/Orchestra/blob/develop/deployment/finalbuilder/Orchestra.CreatePackages.fbp7
And a fixed url so I can update it in the meantime:
https://github.com/WildGums/Orchestra/blob/a2d32b3305e17461c9d0b90c967cfe52c962a196/deployment/finalbuilder/Orchestra.CreatePackages.fbp7
Hi Geert,
I can’t see the direct reason as to why this corruption occurred. Our only thoughts are around UTF16 not being supported by a number of tools out there. Git diff for example has issues with UTF16 files.
We suggest saving the file as UTF8 for compatibility. You can change the default settings in your FinalBuilder installation options.