Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- ## Ascii to Fraktur unicode -- Usage: ascii2fraktur <foo.txt >bar.txt
- while IFS= read -d$'\0' -r -n1 c # read single bytes
- do
- printf -vd "%d" "'$c" # decimal ordinal
- (( d >= 65 && d <=90 )) && (( d += 120107 )) # A-Z -> Fractur bold
- ((d >= 97 && d <= 122 )) && (( d += 120101 )) # a-z -> Fractur bold
- (( d > 255 )) && printf \\U$(printf "%08X" "$d") # Unicode UTF-8
- (( d < 256 )) && printf "%s" "$c" # Echo other stuff
- done
Advertisement
Add Comment
Please, Sign In to add comment