MuseScore 2.0 can't open certain files created with MuseScore 1.3

• Apr 15, 2014 - 14:04
Type
Functional
Severity
S4 - Minor
Status
closed
Project

MuseScore 1.3, in particular on Mac OSX, can create files with invalid XML characters in text elements. I have seen files with the following characters 0x00, 0x03, 0x10, 0x11, 0x12, 0x0C, 0x1e, 0x1b.

See attached file.

Attachment Size
stafftext.mscz 1.48 KB

Comments

An ugly fix. Add the following here

      dbuf.replace(QByteArray("\u0000"), QByteArray(""));
      dbuf.replace(QByteArray("\u0003"), QByteArray(""));
      dbuf.replace(QByteArray("\u0010"), QByteArray(""));
      dbuf.replace(QByteArray("\u0011"), QByteArray(""));
      dbuf.replace(QByteArray("\u0012"), QByteArray(""));
      dbuf.replace(QByteArray("\u000C"), QByteArray(""));
      dbuf.replace(QByteArray("\u001B"), QByteArray(""));
      dbuf.replace(QByteArray("\u001E"), QByteArray(""));

Unfortunately, it comes with a performance cost (around 100ms for the file I tested with). And it's executed even for files without this problem, especially MuseScore 2.0 files.

It also caused some 120 new warnings to show up during compile:
redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
and
redeclared without dllimport attribute after being referenced with dll linkage [enabled by default]