Code from revision 2541 doesn't compile
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
Revision 2482 had the text in UTF-8 but it caused compilation problems. I changed it to an escaped ASCII sequence in revision 2489 to address this problem.
For details see http://n2.nabble.com/Compile-error-on-mac-after-r2482-preferences-cpp-U…
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?)
I'll try to implement the proposition on the mailing list with an external file next week.
It should solve this problem together with the "easy addition" of a language and a first step toward #3895: Self deployable language packs in MuseScore.
Comments and ideas are welcome.
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
Just to be clear, the mac compiler was ok with UTF-8 but it does not compile if the file has a BOM.
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
wynnmc, see my responses (1 and 2 ) in the thread we mentioned.
In all case, I'm working on an external file with the languages list. Hope to have a patch soon.
The language names are removed from preferences.cpp in r2561.
See #3895: Self deployable language packs in MuseScore
Automatically closed -- issue fixed for 2 weeks with no activity.