spamsink: (lenin)
[personal profile] spamsink

Мне всё надоело, и я написал скрипт
#!/usr/bin/env perl
@mask = (0,192,224,240);
@limit = (1<<7,1<<5,1<<4,1<<3);
while (@ARGV) {
$c = hex shift;
die if $c > 1114111;
$str = '';
while (1) {
        if ($c < $limit[length($str)]) {
                $cur = $c | $mask[length($str)];
                $str = chr($cur) . $str;
                last;
        } else {
                $cur = $c&63|128;
                $str = chr($cur) .$str;
                $c >>= 6;
        }
}
print $str;
}
print "\n";

По-моему, вполне 💠.

Date: 2014-07-03 07:21 am (UTC)
From: [identity profile] fatoff.livejournal.com
Символ каравайности:

Profile

spamsink: (Default)
spamsink

May 2025

S M T W T F S
     123
4 567 8910
11121314151617
18 19 2021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 31st, 2025 03:42 pm
Powered by Dreamwidth Studios
OSZAR »