Code from revision 2541 doesn't compile

• Jan 2, 2010 - 19:42
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Running on Gentoo with gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4

There are errors in mscore/trunk/mscore/mscore/preferences.cpp where, in a string, \x is followed by 4 hex digits. There are also errors due to a letter (a-f) following an \x escape sequence.

The following patch (see attachment) allows compilation to complete.

Many thanks for your work on this wonderful piece of software,

Chris Martin

Attachment Size
preferences.patch 3.11 KB

Comments

Thanks for the patch. How did to get the escape sequence? What encoding is it in? When I build and go to Edit > Preferences and look at the languages menu it shows many of the language names as a combination of letters, empty squares, and numbers. (The version without your patch also had some problems with squares in the language menu but not as many).

Hi David

The code sequence wasn't mine, it was there when I tried to compile it and, yes, more work needs to be done. As you point out, the language names with the escape sequences are gobbledygook in Edit > Preferences > Languages.

Next step: find out the Unicode glyphs which correspond to the escape sequences, replace the strings with Unicode strings and try again.

Chris

The escaped values were 16bit wide which the c++ compiler does not understand. They must be splittet into byte values (dont know the byte ordering for utf8, LSB or MSB first?)

Hi David

There seems to be a compiler incompatibility problem here: gcc didn't like the 16-bit escapes but is happy with Unicode -- I have replaced the strings which gcc errored by Unicode strings and it all compiles and works -- but you say that the Mac compiler has problems with Unicode strings.

I think the problem with the converted single byte escapes not displaying correctly has something to do with the way Qt handles languages, there may be something in the strings which it uses to determine whether they are single byte, double byte or a mixture of the two (UTF-8). The conversion of the double byte escapes into single byte confuses it.

I am attaching the Unicode patch which works with gcc in case it has something useful in it.

Chris

Attachment Size
preferences.patch 3.77 KB

Thanks lasconic, I've checked and the preferences.cpp file produced by running the patch on the original 2541 preferences.cpp doesn't start with a BOM.

Perhaps it will compile both with gcc and with the Mac compiler...

I've had a look at the development mailing list and the forum now but I haven't seen anything about a BOM being required. Does the Windows compiler need this?

Chris