38 |
-field_name_validation => 1, ## Method level option. |
-field_name_validation => 1, ## Method level option. |
39 |
-field_sort => 0, |
-field_sort => 0, |
40 |
#-format => 'mail-rfc2822', |
#-format => 'mail-rfc2822', |
41 |
|
-header_default_charset => 'iso-2022-int-1', |
42 |
|
-header_default_charset_input => 'iso-2022-int-1', |
43 |
-linebreak_strict => 0, ## Not implemented completely |
-linebreak_strict => 0, ## Not implemented completely |
44 |
-line_length_max => 60, ## For folding |
-line_length_max => 60, ## For folding |
45 |
#ns_default_phuri |
#ns_default_phuri |
357 |
-format => $self->{option}->{format}, |
-format => $self->{option}->{format}, |
358 |
-field_ns => $option{ns}, |
-field_ns => $option{ns}, |
359 |
-field_name => $name, |
-field_name => $name, |
360 |
|
-header_default_charset => $self->{option}->{header_default_charset}, |
361 |
|
-header_default_charset_input => $self->{option}->{header_default_charset_input}, |
362 |
-parse_all => $self->{option}->{parse_all}, |
-parse_all => $self->{option}->{parse_all}, |
363 |
%vopt); |
%vopt); |
364 |
} else { |
} else { |
367 |
-format => $self->{option}->{format}, |
-format => $self->{option}->{format}, |
368 |
-field_ns => $option{ns}, |
-field_ns => $option{ns}, |
369 |
-field_name => $name, |
-field_name => $name, |
370 |
|
-header_default_charset => $self->{option}->{header_default_charset}, |
371 |
|
-header_default_charset_input => $self->{option}->{header_default_charset_input}, |
372 |
-parse_all => $self->{option}->{parse_all}, |
-parse_all => $self->{option}->{parse_all}, |
373 |
%vopt); |
%vopt); |
374 |
} |
} |
568 |
} |
} |
569 |
|
|
570 |
sub _n11n_field_name ($$) { |
sub _n11n_field_name ($$) { |
571 |
|
no strict 'refs'; |
572 |
my $self = shift; |
my $self = shift; |
573 |
my $s = shift; |
my $s = shift; |
574 |
$s =~ s/^$REG{WSP}+//; $s =~ s/$REG{WSP}+$//; |
$s =~ s/^$REG{WSP}+//; $s =~ s/$REG{WSP}+$//; |
726 |
$max = 20 if $max < 20; |
$max = 20 if $max < 20; |
727 |
|
|
728 |
my $l = $option{-initial_length} || 0; |
my $l = $option{-initial_length} || 0; |
729 |
$string =~ s{((?:^|[\x09\x20])[^\x09\x20]+)}{ |
$l += length $1 if $string =~ /^([^\x09\x20]+)/; |
730 |
|
$string =~ s{([\x09\x20][^\x09\x20]+)}{ |
731 |
my $s = $1; |
my $s = $1; |
732 |
if ($l + length $s > $max) { |
if (($l + length $s) > $max) { |
733 |
$s = "\x0D\x0A\x20" . $s; |
$s = "\x0D\x0A\x20" . $s; |
734 |
$l = length ($s) - 2; |
$l = 1 + length $s; |
735 |
} else { $l += length $s } |
} else { $l += length $s } |
736 |
$s; |
$s; |
737 |
}gex; |
}gex; |