From 241314869ffedc026a5d151925aa7f6b64679ad1 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Mon, 22 Sep 2014 15:53:56 +0200 Subject: [PATCH] Issue 4125: Disable character set recognition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GUILE 1.8 presumably does not make use of the LC_CTYPE information and just does its input/output/string processing in 8bit chunks. For the sake of getting comparable results at first when working on GUILE 2.0, we switch off character set recognition here. At a later point of time, integration with the character processing of GUILE 2.0 may be attempted but since this is an entirely new can of worms with its own performance pitfalls, we put this aside for now. --- lily/main.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lily/main.cc b/lily/main.cc index 7fb2f32457..bae977603c 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -18,6 +18,7 @@ */ #include "main.hh" +#include "lily-guile.hh" #include #include @@ -553,6 +554,20 @@ setup_localisation () Disable localisation of float values. */ setlocale (LC_NUMERIC, "C"); +#if GUILEV2 + // In order not to have this porting aid backfire to GUILE1 usage, + // this is only compiled in the GUILEV2 version. It should + // eventually be replaced with proper multibyte communication with + // GUILE2, but in the mean time it seems that this is the least + // invasive path to get comparable results between the + // not-really-multibyte-supporting GUILE1 and GUILE2 + + /* Disable character sets */ + setlocale (LC_CTYPE, "C"); + /* But our text domain is in UTF-8 */ + bind_textdomain_codeset ("lilypond", "UTF-8"); +#endif + string localedir = LOCALEDIR; if (char const *env = getenv ("LILYPOND_LOCALEDIR")) localedir = env; -- 2.39.2