-
Notifications
You must be signed in to change notification settings - Fork 936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support uu encoding #796
support uu encoding #796
Conversation
@jeremy can I haz merge ? |
NAME = "x-uuencode" | ||
|
||
def self.decode(str) | ||
str.gsub(/^begin \d+ [^\n]*\n/, '').unpack('u').join |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah .. don't hold your breath for a response ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll only need to strip a single leading line:
str.sub(/\Abegin \d+ [^\n]*\n/, '').unpack('u').first
Looks fine to me. Have you taken a look at #812 by any chance? |
end | ||
|
||
def self.encode(str) | ||
[str].pack("u") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the header line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's optional ...
good to merge ? |
4b93783
to
b897fa8
Compare
NAME = "x-uuencode" | ||
|
||
def self.decode(str) | ||
str.sub(/\Abegin \d+ [^\n]*\n/, '').unpack('u').first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious if there is a reference you looked at to generate this expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was part of our legacy email structure, no idea where it came from, but
works with the attachments we have seen so far, which are prefixed with
"begin 644 Invoice.pdf" etc
On Thu, Oct 23, 2014 at 7:09 PM, Benjamin Fleischer <
[email protected]> wrote:
In lib/mail/encodings/unix_to_unix.rb:
@@ -0,0 +1,17 @@
+module Mail
- module Encodings
- module UnixToUnix
NAME = "x-uuencode"
def self.decode(str)
str.sub(/\Abegin \d+ [^\n]*\n/, '').unpack('u').first
Just curious if there is a reference you looked at to generate this
expression.—
Reply to this email directly or view it on GitHub
https://github.com/mikel/mail/pull/796/files#r19320162.
@jeremy good to go ? |
is this good to go now ? |
Thank you @grosser ❤️ |
thanks for merging, 1 less hack in our project :) |
fixes #755
@jeremy @bf4 @mikel