- Add support for reading UTF-16 and UTF-32 files
This commit is contained in:
parent
4f44bc69b5
commit
ea3e205b13
@ -72,6 +72,8 @@ ls -la $RPM_BUILD_ROOT/etc/profile.d
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
- Add support for reading UTF-16 and UTF-32 files
|
||||
Resolves: #638312
|
||||
- Don't require correct exit status from LESSOPEN scripts until
|
||||
it gets accepted by upstream (preserve backward compatibility)
|
||||
Resolves: #666084, #676057
|
||||
|
14
lesspipe.sh
14
lesspipe.sh
@ -50,8 +50,20 @@ lesspipe() {
|
||||
else
|
||||
echo "No identify available"
|
||||
echo "Install ImageMagick or GraphicsMagick to browse images"
|
||||
exit 1
|
||||
fi ;;
|
||||
*)
|
||||
if [ -x /usr/bin/file -a -x /usr/bin/iconv -a -x /usr/bin/cut ]; then
|
||||
case `file "$1"` in
|
||||
*UTF-16*) conv='UTF-16' ;;
|
||||
*UTF-32*) conv='UTF-32' ;;
|
||||
esac
|
||||
env=`echo $LANG | cut -d. -f2`
|
||||
if [ -n "$conv" -a -n "$env" -a "$conv" != "$env" ]; then
|
||||
iconv -f $conv -t $env "$1"
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
exit 1
|
||||
esac
|
||||
exit $?
|
||||
@ -62,7 +74,7 @@ if [ ! -e "$1" ] ; then
|
||||
fi
|
||||
|
||||
if [ -d "$1" ] ; then
|
||||
/bin/ls -alF -- "$1"
|
||||
ls -alF -- "$1"
|
||||
exit $?
|
||||
else
|
||||
lesspipe "$1" 2> /dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user