songy

telegram bot as a songbook
git clone git://git.relim.de/songy.git
Log | Files | Refs | README | LICENSE

commit 6b2f3c5607b17ea4e69a22989ccb801a0525ce88
parent f6f1a08b4bd482d6d443b3969907a14cc2f6edf0
Author: devnibo <kroekerrobin@gmail.com>
Date:   Mon, 19 Aug 2024 21:54:01 +0200

Avoid 'tr' in script for unicode support

The GNU tr program lacks support for multibyte
characters. That's what I've read and experienced.

Diffstat:
Mprepare_for_search.sh | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/prepare_for_search.sh b/prepare_for_search.sh @@ -2,7 +2,9 @@ # $1 is the folder of chordpro files shrink() { - echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d "\n,%!?:()'\"\`’‘ " + # echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d "\n,%!?:()'\"\`’‘ " + # 'tr' doesn't handle multi byte characters well + echo "$1" | awk '{ print tolower($0) }' | sed "s/[(\^$),%!?:()'\"\`’‘ ]//g" | tr -d "\n" } for filename in "$1/"*.cho;