blog.darkstar.work - a simple url encoder/decoder

 a simple url encoder/decoder
 http://blog.darkstar.work

Labels

Wirtschaft (149) Pressefreiheit (124) Österreich (120) IT (96) code (61) Staatsschulden (37) EZB (27) Pensionssystem (16)

2024-03-07

html uft-8 symbol generation shell script

I wrote tonight a short uft-8 html escapes generating shell script,
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


see full script at pastebin.com/0aNumds1 

hexsym.sh

Keine Kommentare:

Kommentar veröffentlichen