diff --git a/cmake/MpVerovio.cmake b/cmake/MpVerovio.cmake index 8c15217a..d5da4ede 100644 --- a/cmake/MpVerovio.cmake +++ b/cmake/MpVerovio.cmake @@ -100,7 +100,10 @@ if(MP_VEROVIO_CCACHE_DIR) endif() # Third-party code: its warnings are not ours to act on. if(MSVC) - target_compile_options(mp_verovio PRIVATE /W0 /bigobj /O1 /Gy /Gw) + # /utf-8: its sources hold UTF-8 text, such as the dashes round a page + # number and the accidentals of a chord symbol, which MSVC otherwise reads + # in the system code page. + target_compile_options(mp_verovio PRIVATE /W0 /bigobj /O1 /Gy /Gw /utf-8) # Unused functions and data left out, and identical ones folded. The # release default already, unless a configuration asks for debug # information; stated so that one does too. diff --git a/tests/test_score.cpp b/tests/test_score.cpp index 4d65f0dd..f38a939d 100644 --- a/tests/test_score.cpp +++ b/tests/test_score.cpp @@ -208,6 +208,16 @@ class ScoreEngraverTest final : public mp::test::Test { size_t notes = 0; for (int p = 1; p <= eng.pageCount(); ++p) notes += countOf(eng.renderPage(p), "class=\"note\""); MP_CHECK(notes == 6, "no note is lost when the page narrows"); + // The second page's number sits between two en dashes, U+2013. + { + mp::ScoreEngraver trio(MP_TEST_SCORE_DATA_DIR); + trio.setPage(300, 300, 100); + MP_CHECK(trio.load(readScoreFixture("organ-trio.musicxml")) && trio.pageCount() >= 2, + "the trio on a small page takes several pages, got " + std::to_string(trio.pageCount())); + const std::string second = trio.renderPage(2); + MP_CHECK(second.find("\xe2\x80\x93") != std::string::npos && second.find("\xc3\xa2") == std::string::npos, + "the page number's dashes are en dashes"); + } MP_CHECK(!eng.midiBase64().empty(), "the score is given as MIDI"); MP_CHECK(eng.timemapJson().find("tstamp") != std::string::npos, "and as a time map");