XML file from Sibelius + Dolet plugin fails on import if defined as "UTF16"

• Jan 19, 2018 - 11:33

Export from Sibelius 7.1.3, using MusicXML 3.0
Import into MuseScore 2.1 on Windows 10

Can anyone shed some light on this "gotcha" which just tripped me up? I don't use Sibelius, so I rely on XML to transfer scores to MuseScore. A friend had typeset a large work in Sibelius, and at my request he had also installed the Dolet plugin - because the previous XML export by Sibelius had thrown up a lot of errors.

When I tried to import the new XML file exported by Dolet, MuseScore reported an error:
"Fatal error: line 1 column 56 Start tag expected."

I compared the old Sibelius XML export with the new Dolet XML export, and the first line does differ:
- Sibelius: ?xml version="1.0" encoding='UTF-8' standalone='no' ?
- Dolet: ?xml version='1.0' encoding='UTF-16' standalone='no'?

I edited the Dolet XML to change 'UTF16' to 'UTF8', and then tried again to import into MuseScore. The XML file now imported without any errors or warnings, and the major problems I had seen when using the Sibelius XML were gone. So the XML exported by the Dolet plugin is superior.

But my two questions for anyone familiar with Sibelius and XML are:
"Is there an option in Sibelius or Dolet to switch the XML export between UTF8 and UTF16?"
"Should MuseScore be able to handle the UTF16 header anyway?"


Comments

Yes, MuseScore should be able to open MusicXML in any encoding. If ti can't, we have a bug to solve.

As always, without access to the offending file it may be hard to find the cause. Could you share the file, or perhaps a simplified version exhibiting the same issue ?

In reply to by Leon Vinken

Leon, thanks for the comment.

Attached is a shortened version of the "rogue" file exported from Sibelius by the Dolet plugin. Because the file was oversize (8Mb), I have removed all the data apart from the opening XML sections "identification" and "defaults". The truncated file still shows the same fatal error message when I try to import it into MuseScore. I'm not sure whether the encoding is the problem, or the actual declaration 'UTF16' in line 1.

In reply to by DanielR

... a quick update.

I just received a completely different MusicXML file for a different work, from a different typesetter. This XML file was declared as 'UTF16' as follows:
?xml version='1.0' encoding='UTF-16' standalone='no'?

And this new UTF16 file imported instantly into MuseScore without any problem. So perhaps I have to assume that the "rogue" file in my original post had a mismatch between the actual encoding and the declared encoding? Any ideas how that might have occurred?

In reply to by Marc Sabatella

The file somehow got corrupted. Don't know what caused this. I have seen UTF-16 encoded files produced by Sibelius in the past, these loaded into MuseScore without issues.

Details:
The truncated score is encoded in UTF-8 with byte order mark, but incorrectly states it is encoded in UTF-16. This, indeed, leads to the "Fatal error: line 1 column 56 Start tag expected." error. Simply replacing "UTF-16" by "UTF-8" is sufficient to open the file in MuseScore. As you have truncated a bit too much (there is no part list, nor are there any parts), this leads to another (expected) error.

Do you still have an unanswered question? Please log in first to post your question.