GNU bug report logs -
#16463
'file-encoding' truncates encoding name
Previous Next
Reported by: sreeharsha <at> totakura.in
Date: Thu, 16 Jan 2014 12:09:02 UTC
Severity: normal
Found in version 2.0.9
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
Full log
Message #36 received at control <at> debbugs.gnu.org (full text, mbox):
reassign 16463 guile 2.0.9
retitle 16463 ‘file-encoding’ truncates encoding name
thanks
Sree Harsha Totakura <sreeharsha <at> totakura.in> skribis:
> On 01/17/2014 11:44 AM, Ludovic Courtès wrote:
>> What does this report:
>>
>> ./meta/guile -c '(pk (file-encoding (open-input-file
>> "test-suite/standalone/test-command-line-encoding2")))'
>
> It reports:
>
>> bash-4.2$ meta/guile -c '(pk (file-encoding (open-input-file
>> "test-suite/standalone/test-command-line-encoding2")))' ;;;
>> ("ISO-885")
OK, that’s the problem.
I can reproduce it by changing the shebang to this:
--8<---------------cut here---------------start------------->8---
#!/foo/nix/store/bwjl94kaigsxd64pgzs2j1cj0wn67v76-glibc-2.18/bin/sh
--8<---------------cut here---------------end--------------->8---
This is a bug in Guile’s encoding-cookie scanner: it looks for the
string ‘coding:’ in the first 500 bytes of the file. Here it does find
it and proceeds to read the next token, except that it stops at 500
bytes, thereby truncating the encoding name.
I’ll look for a fix on the Guile side.
In the meantime, I’m afraid there is no nice way to work around it in
your Guix install. You could work around it by using a shorter store
directory name, or you could have a local patch in guile.scm that
changes ‘test-command-line-encoding2’ to read ‘coding: utf-8’...
Thanks,
Ludo’.
This bug report was last modified 11 years and 186 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.