]> git.proxmox.com Git - mirror_novnc.git/blob - utils/b64-to-binary.pl
Add Spanish translation
[mirror_novnc.git] / utils / b64-to-binary.pl
1 #!/usr/bin/env perl
2 use MIME::Base64;
3
4 for (<>) {
5 unless (/^'([{}])(\d+)\1(.+?)',$/) {
6 print;
7 next;
8 }
9
10 my ($dir, $amt, $b64) = ($1, $2, $3);
11
12 my $decoded = MIME::Base64::decode($b64) or die "Could not base64-decode line `$_`";
13
14 my $decoded_escaped = join "", map { "\\x$_" } unpack("(H2)*", $decoded);
15
16 print "'${dir}${amt}${dir}${decoded_escaped}',\n";
17 }