Show
Ignore:
Timestamp:
07/27/06 13:40:30 (2 years ago)
Author:
ogawa
Message:

Now can choose to use NCR encoding by config.yaml.
Add X-WR-TIMEZONE header.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cybozu2ical/trunk/cybozu2ical

    r321 r328  
    77use YAML; 
    88use LWP::UserAgent; 
    9 use Encode qw/from_to decode_utf8 encode_utf8/; 
     9use Encode qw/from_to decode_utf8 encode/; 
    1010use Text::CSV_XS; 
    1111use Data::ICal; 
     
    1818use Getopt::Long; 
    1919 
    20 our $VERSION = '0.04'; 
     20our $VERSION = '0.05'; 
    2121our $ENCODE_NCR = 0; 
    2222 
     
    4343 
    4444my $content = $res->content; 
    45 from_to($content, 'shiftjis', 'utf8'); 
     45from_to($content, $cfg->{input_encoding} || 'shiftjis', 'utf8'); 
    4646my @lines = grep /^\d+,ts\.\d+,/, split(/\r?\n/, $content); 
    4747 
     
    117117$vcalendar->add_entry($vtimezone); 
    118118 
    119 print $ENCODE_NCR ? 
     119my $enc = $cfg->{output_encoding} || 'utf8'; 
     120print ($enc eq 'ncr') ? 
    120121    encode_ncr($vcalendar->as_string) : 
    121     encode_utf8($vcalendar->as_string); 
     122    encode($enc, $vcalendar->as_string); 
    122123 
    123124sub encode_ncr {