sloccount should be updated to properly handle UTF-8 locales
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sloccount (Debian) |
Fix Released
|
Unknown
|
|||
sloccount (Ubuntu) |
Fix Released
|
Low
|
MOTU |
Bug Description
Package: sloccount
Version: 2.26-2
sloccount generates warnings from perl.
$ mkdir foo
$ cd foo
$ sloccount .
Creating filelist for foo
Categorizing files.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "en_GB"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Computing results.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "en_GB"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
SLOC Directory SLOC-by-Language (Sorted)
0 foo (none)
SLOC total is zero, no further analysis performed.
$ cd ..
$ rmdir foo
$
I think it's because it meddles with $LANG.
$ awk '/Perl/, /^fi/' /usr/bin/sloccount
# Perl 5.8.0 handles the "LANG" environment variable oddly;
# if it includes ".UTF-8" (which is does in Red Hat Linux 9 and others)
# then it will bitterly complain about ordinary text.
# So, we'll need to filter ".UTF-8" out of LANG.
if [ x"$LANG" != x ]
then
LANG=`echo "$LANG" | sed -e 's/\.UTF-8//'`
export LANG
# echo "New LANG variable: $LANG"
fi
$
A simpler example.
$ perl -w -e 0
$ LANG=${LANG%.UTF-8} perl -w -e 0
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "en_GB"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
$
Perhaps it no longer needs to meddle, or its meddling isn't complete
enough.
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.10-5-386
Locale: LANG=en_GB.UTF-8, LC_CTYPE=
Versions of packages sloccount depends on:
ii libc6 2.3.2.ds1-
ii perl 5.8.4-6ubuntu1 Larry Wall's Practical Extraction
-- no debconf information
Changed in sloccount: | |
assignee: | nobody → motu |
Changed in sloccount: | |
status: | Unknown → Fix Released |
Confirmed on Dapper Beta