+ string output_mod = "scm output-" + name;
+ SCM mod = scm_c_resolve_module (output_mod.c_str ());
+
+ bool has_utf8_string = false;
+
+ if (ly_is_module (mod))
+ {
+ SCM utf8_string = ly_module_lookup (mod, ly_symbol2scm ("utf-8-string"));
+ /*
+ has_utf8_string should only be true when utf8_string is a
+ variable that is bound to a *named* procedure, i.e. not a
+ lambda expression.
+ */
+ if (utf8_string != SCM_BOOL_F
+ && scm_procedure_name (SCM_VARIABLE_REF (utf8_string)) != SCM_BOOL_F)
+ has_utf8_string = true;
+ }
+
+ bool to_paths = music_strings_to_paths;
+
+ /*
+ Backends with the utf-8-string expression use it when
+ 1) the -dmusic-strings-to-paths option is set
+ and `str' is not a music string, or
+ 2) the -dmusic-strings-to-paths option is not set.
+ */
+ if (has_utf8_string && ((to_paths && !music_string) || !to_paths))