site  contact  subhomenews

rev utility broken if LANG=C and UTF-8 char

June 27, 2024 — BarryK

Forum member Caramel posted about this:

https://forum.puppylinux.com/viewtopic.php?p=124017#p124017

In the rootfs-skeleton folder in woofQ, ran these tests:

# cd rootfs-skeleton/usr/bin
# grep -rl ' rev ' . | xargs -I XXX grep -l 'LANG=C' XXX | sort
./clean_desk_icons
./inxi
./mscw
./mscw-alsa
./xorgwizard
./xorgwizard-automatic

Also:

# cd rootfs-skeleton/usr/local
# grep -rl ' rev ' . | xargs -I XXX grep -l 'LANG=C' XXX | sort
./bin/drive_all
./easy_version/easy-update
./limine-installer/find-installations
./momanager/momanager
./petget/0setup
./petget/downloadpkgs.sh
./petget/filterpkgs.sh
./petget/installpkg.sh
./petget/installpreview.sh
./petget/petget
./pup_event/frontend_change
./sfsget/dir2sfs
./sfsget/sfsget
./video_upgrade/video_upgrade_wizard-OLD

I studied these scripts to determine if any might be in that situation where 'rev' has UTF-8 characters as input. Found, maybe, sfsget/dir2sfs, petget/installpkg.sh and momanager/momanager

Some scripts have "LANG=C" as they parse output from utilities that might be non-English otherwise. So unwise to just remove the LANG=C without careful consideraton. Instead, in those scripts I just prefixed 'rev' with " | LANG=$ORIGLANG rev  | "     

Tags: easy