Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Ascii to high unicode script -- Usage: ascii2script "text"
- s=$(printf "%s" "$*")
- for ((j=0; j<${#s}; j++)); do
- printf -vd "%d" "'${s:j:1}" # decimal ordinal
- (( d >= 65 && d <=90 )) && (( d += -65 +0x1D4D0 )) # A-Z
- ((d >= 97 && d <= 122 )) && (( d += -97 +0x1D4EA )) # a-z
- (( d > 255 )) && printf "&#x$(printf '%X' $d);" # HTML entity
- (( d < 256 )) && printf "%s" "${s:j:1}" # Echo other stuff
- done
- echo
Advertisement
Add Comment
Please, Sign In to add comment