Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l ht2 {
- if ($version >= 7) || ($1 <= 255) { returnex $chr($1) }
- else {
- if ($1 >= 256) && ($1 < 2048) returnex $chr($calc(192 + $int($calc($1 / 64)))) $+ $chr($calc(128 + ($1 % 64)))
- elseif ($1 >= 2048) && ($1 < 65536) returnex $+($chr($calc(224 + $int($calc($1 / 4096)))),$chr($calc(128 + ($int($calc($1 / 64)) % 64))),$chr($calc(128 + ($1 % 64))))
- elseif ($1 >= 65536) && ($1 < 2097152) returnex $+($chr($calc(240 + $int($calc($1 / 262144)))),$chr($calc(128 + ($int($calc($1 / 4096)) % 64))),$chr($calc(128 + ($int($calc($1 / 64)) % 64))),$chr($calc(128 + ($1 % 64))))
- }
- }
- alias -l html_fix {
- if (!$1) { return }
- if (#x* iswm $1) { return $ht2($base($mid($1,3),16,10)) }
- if (#* iswm $1) { return $ht2($mid($1,2)) }
- return $1-
- }
- alias html2asciix { return $regsubex(~, $1, /&(.+);/Ug, $html_fix(\t)) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement