[Rt-commit] r4472 - in Data-ICal: . lib/Data/ICal

glasser at bestpractical.com glasser at bestpractical.com
Fri Feb 3 14:13:45 EST 2006


Author: glasser
Date: Fri Feb  3 14:13:45 2006
New Revision: 4472

Modified:
   Data-ICal/   (props changed)
   Data-ICal/lib/Data/ICal/Property.pm
   Data-ICal/t/10.mime-vcal10.t

Log:
 r53612 at david-glassers-powerbook-g4-15:  glasser | 2006-02-03 14:10:07 -0500
 Disable quoted-printable quoting on output, since clients often don't grok it.


Modified: Data-ICal/lib/Data/ICal/Property.pm
==============================================================================
--- Data-ICal/lib/Data/ICal/Property.pm	(original)
+++ Data-ICal/lib/Data/ICal/Property.pm	Fri Feb  3 14:13:45 2006
@@ -279,16 +279,22 @@
     my $self   = shift;
     my $string = shift;
 
-    my $use_equals = $self->vcal10 && 
+    my $quoted_printable = $self->vcal10 && 
         uc $self->parameters->{'ENCODING'} eq 'QUOTED-PRINTABLE';
 
     # We can't just use a s//g, because we need to include the added space/= and
     # first character of the next line in the count for the next line.
 
-    if ($use_equals) {
-        while ( $string =~ /.{75}[^\n=]/ ) {
-            $string =~ s/(.{75})([^\n=])/$1=\n$2/;
-        }
+    if ($quoted_printable) {
+        # In old vcal, quoted-printable properties have different folding rules.
+        # But some interop tests suggest it's wiser just to not fold for vcal 1.0
+        # at all (in quoted-printable).
+
+        # [do nothing]
+
+#        while ( $string =~ /.{75}[^\n=]/ ) {
+#            $string =~ s/(.{75})([^\n=])/$1=\n$2/;
+#        }
     } else {
         while ( $string =~ /(.{76})/ ) {
             $string =~ s/(.{75})(.)/$1\n $2/;

Modified: Data-ICal/t/10.mime-vcal10.t
==============================================================================
--- Data-ICal/t/10.mime-vcal10.t	(original)
+++ Data-ICal/t/10.mime-vcal10.t	Fri Feb  3 14:13:45 2006
@@ -7,13 +7,23 @@
 use Test::LongString;
 use Test::NoWarnings;
 
-my $encoded_vcal = <<'END_VCAL';
+my $encoded_vcal_in = <<'END_VCAL';
 BEGIN:VCALENDAR
 PRODID:Data::ICal 0.07
 VERSION:1.0
 BEGIN:VTODO
 DESCRIPTION;ENCODING=QUOTED-PRINTABLE:interesting things         =0D=0AYeah=
-!!=3D cbla=0D=0A=0D=0A=0D=0AGo team syncml!=0D=0A=0D=0A=0D=0A
+!!=3D =63bla=0D=0A=0D=0A=0D=0AGo team syncml!=0D=0A=0D=0A=0D=0A
+END:VTODO
+END:VCALENDAR
+END_VCAL
+
+my $encoded_vcal_out = <<'END_VCAL';
+BEGIN:VCALENDAR
+PRODID:Data::ICal 0.07
+VERSION:1.0
+BEGIN:VTODO
+DESCRIPTION;ENCODING=QUOTED-PRINTABLE:interesting things         =0D=0AYeah!!=3D cbla=0D=0A=0D=0A=0D=0AGo team syncml!=0D=0A=0D=0A=0D=0A
 END:VTODO
 END:VCALENDAR
 END_VCAL
@@ -30,7 +40,7 @@
 
 BEGIN { use_ok('Data::ICal') }
 
-my $cal = Data::ICal->new(data => $encoded_vcal, vcal10 => 1);
+my $cal = Data::ICal->new(data => $encoded_vcal_in, vcal10 => 1);
 
 isa_ok($cal, 'Data::ICal');
 
@@ -50,7 +60,7 @@
 $todo->add_property(description => $decoded_desc);
 
 $cal->entries->[0]->property('description')->[0]->encode('QUotED-PRintabLE');
-is_string($cal->as_string, $encoded_vcal);
+is_string($cal->as_string, $encoded_vcal_out);
 
 
 __END__


More information about the Rt-commit mailing list