diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2022-10-25 18:22:21 +0200 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2022-10-25 21:47:18 +0200 |
commit | 33647b6d63fe3062361a23a901664a379c07097f (patch) | |
tree | 8a6afc5a2c2b4d2d19f8bc98342b2f6c1382bc24 /doc/lispref/text.texi | |
parent | e5cb66c046be440ca63fb384ea93f450aa4f958e (diff) | |
download | emacs-33647b6d63fe3062361a23a901664a379c07097f.tar.gz |
Ignore non-base64 junk when decoding MIME
* src/fns.c (Fbase64_decode_region): Add optional argument
IGNORE-INVALID and pass down to base64_decode_1.
(Fbase64_decode_string): Likewise.
(base64_decode_1): Add argument IGNORE_INVALID.
* doc/lispref/text.texi (Base 64): Document them.
* lisp/gnus/mm-bodies.el (mm-decode-content-transfer-encoding):
Ignore any junk when decoding base64.
Diffstat (limited to 'doc/lispref/text.texi')
-rw-r--r-- | doc/lispref/text.texi | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 509ce56725d..d1010db515d 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -4876,7 +4876,7 @@ If the optional argument @var{no-pad} is non-@code{nil} then this function doesn't generate the padding. @end defun -@deffn Command base64-decode-region beg end &optional base64url +@deffn Command base64-decode-region beg end &optional base64url ignore-invalid This function converts the region from @var{beg} to @var{end} from base 64 code into the corresponding decoded text. It returns the length of the decoded text. @@ -4885,9 +4885,11 @@ The decoding functions ignore newline characters in the encoded text. If optional argument @var{base64url} is non-@code{nil}, then padding is optional, and the URL variant of base 64 encoding is used. +If optional argument @var{ignore-invalid} is non-@code{nil}, then any +unrecognized characters are ignored. @end deffn -@defun base64-decode-string string &optional base64url +@defun base64-decode-string string &optional base64url ignore-invalid This function converts the string @var{string} from base 64 code into the corresponding decoded text. It returns a unibyte string containing the decoded text. @@ -4897,6 +4899,8 @@ The decoding functions ignore newline characters in the encoded text. If optional argument @var{base64url} is non-@code{nil}, then padding is optional, and the URL variant of base 64 encoding is used. +If optional argument @var{ignore-invalid} is non-@code{nil}, then any +unrecognized characters are ignored. @end defun @node Checksum/Hash |