You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2023/12/08 07:37:26 UTC
svn commit: r1914452 - in /spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor: Client.pm Digest.pm Digest/Pieces.pm Digest/StripHtml.pm
Author: hege
Date: Fri Dec 8 07:37:26 2023
New Revision: 1914452
URL: http://svn.apache.org/viewvc?rev=1914452&view=rev
Log:
Clean up unnecessary unicode characters
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Client.pm
spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest.pm
spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/Pieces.pm
spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/StripHtml.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Client.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Client.pm?rev=1914452&r1=1914451&r2=1914452&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Client.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Client.pm Fri Dec 8 07:37:26 2023
@@ -73,7 +73,7 @@ of the status.
=back
(NB: There are additional standard response headers that are useful only for
-the protocol itself and thus are not part of this moduleâs returns.)
+the protocol itself and thus are not part of this module's returns.)
=head2 Reliability
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest.pm?rev=1914452&r1=1914451&r2=1914452&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest.pm Fri Dec 8 07:37:26 2023
@@ -55,12 +55,12 @@ our $VERSION = '0.03';
=head2 $hex = get( $MSG )
This takes an email message in raw MIME text format (i.e., as saved in the
-standard mbox format) and returns the messageâs Pyzor digest in lower-case
+standard mbox format) and returns the message's Pyzor digest in lower-case
hexadecimal.
The output from this function should normally be identical to that of
-the C<pyzor> scriptâs C<digest> command. It is suitable for use in
-L<Mail::SpamAssassin::Pyzor::Client>âs request methods.
+the C<pyzor> script's C<digest> command. It is suitable for use in
+L<Mail::SpamAssassin::Pyzor::Client>'s request methods.
=cut
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/Pieces.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/Pieces.pm?rev=1914452&r1=1914451&r2=1914452&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/Pieces.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/Pieces.pm Fri Dec 8 07:37:26 2023
@@ -35,7 +35,7 @@ Mail::SpamAssassin::Pyzor::Digest::Piece
This module houses backend logic for L<Mail::SpamAssassin::Pyzor::Digest>.
-It reimplements logic found in pyzorâs F<digest.py> module
+It reimplements logic found in pyzor's F<digest.py> module
(L<https://github.com/SpamExperts/pyzor/blob/master/pyzor/digest.py>).
=cut
@@ -68,10 +68,10 @@ a byte string or a character string (e.g
NB: RFC 2822 stipulates that message bodies should use CRLF
line breaks, not plain LF (nor plain CR).
We will thus convert any plain CRs in a quoted-printable message
-body into CRLF. Python, though, doesnât do this, so the output of
+body into CRLF. Python, though, doesn't do this, so the output of
our implementation of C<digest_payloads()> diverges from that of the Python
-original. It doesnât ultimately make a difference since the line-ending
-whitespace gets trimmed regardless, but itâs necessary to factor in when
+original. It doesn't ultimately make a difference since the line-ending
+whitespace gets trimmed regardless, but it's necessary to factor in when
comparing the output of our implementation with the Python output.
=cut
@@ -137,7 +137,7 @@ The above will leave C<$str> alone, but
normalize($str);
-â¦Â will trim off the last two bytes from C<$str>.
+... will trim off the last two bytes from C<$str>.
=cut
@@ -146,7 +146,7 @@ sub normalize { ## no critic qw( Subr
# NULs are bad, mm-kay?
$_[0] =~ tr<\0><>d;
- # NB: Pythonâs \s without re.UNICODE is the same as Perlâs \s
+ # NB: Python's \s without re.UNICODE is the same as Perl's \s
# with the /a modifier.
#
# https://docs.python.org/2/library/re.html
@@ -161,12 +161,12 @@ sub normalize { ## no critic qw( Subr
# Python: re.compile(r'[a-z]+:\S+', re.IGNORECASE)
$_[0] =~ s<[a-zA-Z]+ : \S+><>agx;
- # (from digest.py â¦)
+ # (from digest.py ...)
# Make sure we do the whitespace last because some of the previous
# patterns rely on whitespace.
$_[0] =~ tr< \x09-\x0d><>d;
- # This is fun. digest.pyâs normalize() does a non-UNICODE whitespace
+ # This is fun. digest.py's normalize() does a non-UNICODE whitespace
# strip, then calls strip() on the string, which *will* strip Unicode
# whitespace from the ends.
$_[0] =~ s<\A\s+><>;
@@ -242,7 +242,7 @@ use constant _QUOTED_PRINTABLE_NAMES =>
"quotedprintable",
);
-# Make Encode::decode() ignore anything that doesnât fit the
+# Make Encode::decode() ignore anything that doesn't fit the
# given encoding.
use constant _encode_check_ignore => q<>;
@@ -287,7 +287,7 @@ sub parse_content_type {
$encoding = 'ascii';
}
- # Match Python .decode()âs 'ignore' behavior
+ # Match Python .decode()'s 'ignore' behavior
$checkval ||= \&_encode_check_ignore;
return ( $main, $sub, $encoding, $checkval );
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/StripHtml.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/StripHtml.pm?rev=1914452&r1=1914451&r2=1914452&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/StripHtml.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Pyzor/Digest/StripHtml.pm Fri Dec 8 07:37:26 2023
@@ -37,14 +37,14 @@ Mail::SpamAssassin::Pyzor::Digest::Strip
=head1 DESCRIPTION
-This module attempts to duplicate pyzorâs HTML-stripping logic.
+This module attempts to duplicate pyzor's HTML-stripping logic.
=head1 ACCURACY
This library cannot achieve 100%, bug-for-bug parity with pyzor
-because to do so would require duplicating Pythonâs own HTML parsing
-library. Since that libraryâs output has changed over time, and those
-changes in turn affect pyzor, itâs literally impossible to arrive at
+because to do so would require duplicating Python's own HTML parsing
+library. Since that library's output has changed over time, and those
+changes in turn affect pyzor, it's literally impossible to arrive at
a single, fully-compatible reimplementation.
That said, all known divergences between pyzor and this library involve
@@ -67,13 +67,13 @@ our $VERSION = '0.03';
=head2 $stripped = strip( $HTML )
-Give it some HTML, and itâll give back the stripped text.
+Give it some HTML, and it'll give back the stripped text.
In B<general>, the stripping consists of removing tags as well as
C<E<lt>scriptE<gt>> and C<E<lt>styleE<gt>> elements; however, it also
removes HTML entities.
-This tries very hard to duplicate pyzorâs behavior with invalid HTML.
+This tries very hard to duplicate pyzor's behavior with invalid HTML.
=cut
@@ -114,9 +114,9 @@ sub strip {
return if !$accumulate;
- # pyzorâs HTML parser discards HTML entities. On top of that,
- # we need to match, as closely as possible, pyzorâs handling of
- # invalid HTML entities ⦠which is a function of Pythonâs
+ # pyzor's HTML parser discards HTML entities. On top of that,
+ # we need to match, as closely as possible, pyzor's handling of
+ # invalid HTML entities ... which is a function of Python's
# standard HTML parsing library. This will probably never be
# fully compatible with the pyzor, but we can get it close.
@@ -124,8 +124,8 @@ sub strip {
#
# re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]')
#
- # The parsing loop then âbacks upâ one byte if the last
- # character isnât a â;â. We use a look-ahead assertion to
+ # The parsing loop then "backs up" one byte if the last
+ # character isn't a ";". We use a look-ahead assertion to
# mimic that behavior.
$copy =~ s<\&\# (?:[0-9]+ | [xX][0-9a-fA-F]+) (?: ; | \z | (?=[^0-9a-fA-F]) )>< >gx;
@@ -136,7 +136,7 @@ sub strip {
# We again use a look-ahead assertion to mimic Python.
$copy =~ s<\& [a-zA-Z] [-.a-zA-Z0-9]* (?: ; | \z | (?=[^a-zA-Z0-9]) )>< >gx;
- # Pythonâs HTMLParser aborts its parsing loop when it encounters
+ # Python's HTMLParser aborts its parsing loop when it encounters
# an invalid numeric reference.
$copy =~ s<\&\#
(?:
@@ -151,7 +151,7 @@ sub strip {
( -1 == index($1, ';') ) ? q<> : '&#'
>exs;
- # Pythonâs HTMLParser treats invalid entities as incomplete
+ # Python's HTMLParser treats invalid entities as incomplete
$copy =~ s<(\&\#?)><$1 >gx;
$copy =~ s<\A\s+><>;