guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with wide characters on upgrading to guile 2.x


From: Richard Shann
Subject: Re: Problem with wide characters on upgrading to guile 2.x
Date: Thu, 22 Aug 2013 20:00:16 +0100

On Thu, 2013-08-22 at 11:45 -0700, Mike Gran wrote:
> Hi Richard-
> 
> 
> > scheme@(guile-user)> (string-append "  " "hello")
> 
> > $1 = "  \ue176hello"
> > scheme@(guile-user)> (display  "  ")
> >   scheme@(guile-user)> (display  (string-append "  " 
> > "hello"))
> >   helloscheme@(guile-user)> 
> > I notice that I do not have LC_ALL set in my environment.
> > 
> > From inside Denemo scm_c_eval_string() is being used to evaluate a
> > string that includes this wide character and that is throwing the
> > exception.
> 
> I've been gone a while, so I don't know what the latest is.
> But based on old knowledge...
> 
> 1. Make sure that you Guile script files are UTF-8.  If they
> are not, you'll need to explicitly put a "coding:"
> declaration at the top of each file.

I guess they are (else it would never have worked under 1.8) - typically
they are input to a Gtk widget which I think default to taking utf-8.

> 
> 2. In the inner_main of your scm_with_guile call, 
> try calling scm_setlocale.  Maybe something like this?
> (This shouldn't make a difference, I think. 
> But, if it does, it says something interesting.)
> 
> scm_setlocale( scm_variable_ref(scm_c_lookup("LC_ALL")), 
> scm_from_locale_string("") );

>  If that actually works, lemme know.

I just pasted the above into the start of inner_main() and like magic,
it has fixed the problem. Is this call ok for guile-1.8 linking too?

Thanks very much for the magic

Richard


> 
> -Mike
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]