4 ms·
It would be better if it just represented replies as ASCII chars to avoid perl postprocessing. Most terminals probably doesn't display colored emoji anyway.
by garaetjjte 5y ago
It would be better if it just represented replies as ASCII chars to avoid perl postprocessing. Most terminals probably doesn't display colored emoji anyway.
- dgl 5y agoInterestingly I just tried it on Windows. For me Windows Terminal managed emoji, but only the green square! (After running “chcp 65001”) However the unescaping isn’t needed, nslookup on Windows just outputs the raw data. Makes me wonder if I could just use ANSI terminal escape sequences.
- testplzignore 5y agoHere's an emoji-less version that prints correctly-placed characters in uppercase, incorrectly-placed characters in lowercase, and incorrect characters as spaces. Gotta love bitmask tricks. wd() { dig +short txt $1.example.wd.ip.wtf | head -n1 | perl -pe's/"//g;s/\\226\\172\\156/ /g;s/\\240\\159\\159\\168/chr(255)/eg;s/\\240\\159\\159\\169/chr(223)/eg' | perl -pe'$_&=lc("'$1'")'; }