Re: Quoted-Printable Perl Module
Re: Quoted-Printable Perl Module
- Subject: Re: Quoted-Printable Perl Module
- From: Christopher Stone <email@hidden>
- Date: Fri, 17 Mar 2017 17:06:25 -0500
On Mar 17, 2017, at 10:23, debt <email@hidden> wrote:
Will this work for you? I haven’t worked with MIME before so I don’t know if the output is correct or not.
Hey Marc,
Unfortunately that doesn't work.
Input text:
FIND/REPLACE: ~s/=E2=80=9D|=E2=80=9C/\"/g; ~s/=E2=80=98|=E2=80=99/\'/g; ~s/=E2=80=93/\--/g; ~s/=E2=80=A6/\.../g;
Output text:
FIND/REPLACE: ~s/”|“/\"/g; ~s/‘|’/\'/g; ~s/–/\--/g; ~s/…/\.../g;
This part of an email from a forum that I need to parse.
(Although this part isn't what I need to grab - it's just a nice messy example of QP.)
You're producing this:
FIND/REPLACE:~s/”|“/\"/g;~s/‘|’/\'/g;~s/–/\--/g;~s/…/\.../g;
Although... That looks like it's right except the EOLs have been chomped.
I didn't expect this to work, but it did.
#!/usr/bin/env perl -sw use 5.024; use MIME::QuotedPrint;
my $textInput = q( FIND/REPLACE: ~s/=E2=80=9D|=E2=80=9C/\"/g; ~s/=E2=80=98|=E2=80=99/\'/g; ~s/=E2=80=93/\--/g; ~s/=E2=80=A6/\.../g; );
my $decodedText = decode_qp($textInput); print $decodedText;
--
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden