Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl Tk Icons

by didier (Vicar)
on May 03, 2003 at 19:24 UTC ( #255373=note: print w/replies, xml ) Need Help??


in reply to Perl Tk Icons

This script will does the trick:
It's not very nice but it was written 7 years ago...
use MIME::Base64; unless(defined($ARGV[0])){ print <<'END'; Usage: perl im2b64.pl one.gif two.gif etc... Output is bin2b64.txt Use example of result: $c->Photo('image',-data=>$im_encode,format=>'gif'); END exit; } $c = 0; foreach(@ARGV){ open(K, $_) or die "$!"; binmode(K); foreach(<K>){ $data_im .= $_; } $im_encode = encode_base64($data_im); chop($im_encode); $ARGV[$c] =~ s/\./_/g; $done{$ARGV[$c]} = $im_encode; undef($data_im); $c++; close(K); } $sep = '-' x 35; open(K,">>$ARGV[0].txt") || die "$!"; foreach $key (keys(%done)){ print K "\x24$key = \n\"$done{$key}\\n\\n\"\;\n\n"; print K "$sep\n\n"; } close(K);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://255373]
help
Chatterbox?
[ELISHEVA]: I may have to resort to SOPW - but was hoping that this would be something simple
[erix]: I'd just remove the BOM, it is pretty simple
[ELISHEVA]: Simple yes. and I did consider that. but this isn't one off . An important data source that I don't control is generating bom prefixed utf8 files and I'd rather not have to be munging files every few months.
[erix]: on teh other hand a SOPW is pretty much garanteed to get an answer from tux (and probably the module fixed)
[ELISHEVA]: plus it bugs me that something that *should* be simple, *should* work- unicode and noms aren't exactly the new kids on the block
[ELISHEVA]: well then since the obvious possible mistakes on my part have been ruled out, SOPW it is.
[ELISHEVA]: the data source, or one of them, is the OECD - they provide a *lot* of data that ought to be easily available to perl programmers.
[erix]: it might be cunning to mention the module in the title... :)
[ELISHEVA]: fancy that - a title that actually describes the problem :-)
[ELISHEVA]: but actually thanks for the reminder

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-05-28 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?