Changeset 1951

Show
Ignore:
Timestamp:
09/14/06 16:43:07
Author:
miyagawa
Message:

added currency script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/todo.pl

    r1950 r1951  
    1010=cut 
    1111 
     12use Encode (); 
    1213use YAML (); 
    1314use LWP::UserAgent; 
     
    3233$ua->env_proxy; 
    3334 
    34 binmode STDOUT, ":utf8"; 
     35my $encoding; 
     36eval { 
     37    require Term::Encoding; 
     38    $encoding = Term::Encoding::get_encoding(); 
     39}; 
     40$encoding ||= "utf-8"; 
     41 
     42binmode STDOUT, ":encoding($encoding)"; 
    3543 
    3644main(); 
     
    357365 
    358366    # perl automatically does TRT with $filename eq '-' 
    359     open (my $file, "> $filename") || die("Can't open file '$filename': $!"); 
     367    open (my $file, ">:utf8", $filename) || die("Can't open file '$filename': $!"); 
    360368 
    361369    print $file $result->{_content}{result}; 
     
    428436 
    429437    if ( $res->is_success ) { 
    430         return YAML::Load($res->content)->{fnord}; 
     438        return YAML::Load( Encode::decode_utf8($res->content) )->{fnord}; 
    431439    } else { 
    432440        die $res->status_line;