Update some scripts
This commit is contained in:
parent
83fb9a083a
commit
697c7e105f
5 changed files with 33 additions and 24 deletions
|
@ -5,11 +5,10 @@
|
|||
if [[ $2 ]]; then
|
||||
encoding=$2
|
||||
else
|
||||
encoding=$(chardetect "$1" | grep -oP '(?<=: )\S*')
|
||||
encoding='utf-8'
|
||||
#encoding=$(chardetect "$1" | grep -op '(?<=: )\s*')
|
||||
fi
|
||||
if ! iconv -f $encoding <<<"" &> /dev/null; then
|
||||
cat "$1"
|
||||
elif [[ $encoding != 'utf-8' ]]; then
|
||||
if [[ $encoding != 'UTF-8' ]]; then
|
||||
iconv -f $encoding -t 'utf-8' < "$1" | mdcat /dev/stdin
|
||||
else
|
||||
mdcat $1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue