I wrote tonight a short uft-8 html escapes generating shell script,
see script generated results here: https://area23.at/utf8/.
see script generated results here: https://area23.at/utf8/.
#!/bin/sh
# generates uft-8 symbol html reference
outtext=utf8_pre_sym2000.html
modHex=256
modFF=255
modZero=0
shx=1024
printf "<html>\n<head><title>utf-8 symbol></title></head>\n<body>\n\t<h1>UTF-8 Symbols</h1>\n\t<div><span>\n" > $outtext
while [ $shx -lt 16384 ] ; do
modZero=$(echo "$shx % $modHex" | bc)
if [ $modZero -eq 0 ] ; then
printf "\n<h2>hex x%x ~ dec %d</h2>\n" $shx $shx >> $outtext
printf "\n<pre>symbol\thex x%x \tdecimal %d \t.\n" $shx $shx >> $outtext
fi
printf "&#x%x;\t&#x%x;\t&#%d;\t.\n" $shx $shx $shx >> $outtext
modFF=$(echo "$shx % $modHex" | bc)
if [ $modFF -eq 255 ] ; then
printf "</pre>\n" >> $outtext
fi
shx=$(echo "$shx + 1" | bc);
done
printf "\n\t<hr />\n\t</span></div></body></html>\n" >> $outtext

Keine Kommentare:
Kommentar veröffentlichen