Re: Guile integration and UTF-8

Paul Smith <[email protected]>
Newsgroups gmane.comp.gnu.make.devel
Organization GNU's Not UNIX!
Message-ID <1380076289.8253.78.camel@homebase>
On Tue, 2013-09-24 at 23:11 +0200, Ludovic Courtès wrote:
> Hi,
> 
> Lars Ljung <[email protected]> skribis:
> 
> > 2) This simple example fails because of the UTF-8 string:
> >
> > all:
> > 	@echo $(guile "Hej, världen!")
> >
> > The result is:
> >
> > ERROR: Unknown object: "Hej, världen!".
> 
> Make uses ‘scm_c_eval_string’, which expects to be passed a string in
> the current locale encoding.
> 
> So, if you have a UTF-8-encoded Makefile, but run ‘make’ with a
> ISO-8859-1 locale, the string will be incorrectly decoded.
> 
> In particular, ‘to-string-maybe’ in gmk-default.scm will consider that
> some characters are not printable, leading to the “Unknown object” error.
> 
> The fix would be to convert the string passed to $(guile ...) from a
> fixed encoding, rather than from the current locale encoding.  For
> instance:
> 
>   scm_eval_string (scm_from_utf8_string (argv[0]))
> 
> Better yet, use ‘scm_file_encoding’ to determine the encoding of a
> makefile based on the presence of -*- coding -*- cookies (info "(guile)
> Character Encoding of Source Files").

Thanks Ludo'.  I figured it was something like that.

I haven't made a formal definition, but I'm seriously leaning towards
declaring that makefiles are UTF-8, always, and not supporting other
encodings.  I'd like to discuss the possible downsides with others who
are more versed in i18n issues than I before I do this, and I won't do
it for this release, but I'm really expecting to do it (and document it
as such in the manual, etc.) shortly.



_______________________________________________
Make-alpha mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/make-alpha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.