mirror of
https://github.com/vim/vim
synced 2025-07-16 09:12:00 +00:00
runtime(doc): fix base64 encode/decode examples
Use str2blob()/blob2str() functions in examples given. closes: #16449 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
9904cbca41
commit
6472e58365
@ -1,4 +1,4 @@
|
|||||||
*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 14
|
*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 15
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -1244,7 +1244,7 @@ base64_decode({string}) *base64_decode()*
|
|||||||
" Write the decoded contents to a binary file
|
" Write the decoded contents to a binary file
|
||||||
call writefile(base64_decode(s), 'tools.bmp')
|
call writefile(base64_decode(s), 'tools.bmp')
|
||||||
" Decode a base64-encoded string
|
" Decode a base64-encoded string
|
||||||
echo list2str(blob2list(base64_decode(encodedstr)))
|
echo blob2str(base64_decode(encodedstr))
|
||||||
<
|
<
|
||||||
Can also be used as a |method|: >
|
Can also be used as a |method|: >
|
||||||
GetEncodedString()->base64_decode()
|
GetEncodedString()->base64_decode()
|
||||||
@ -1260,7 +1260,7 @@ base64_encode({blob}) *base64_encode()*
|
|||||||
" Encode the contents of a binary file
|
" Encode the contents of a binary file
|
||||||
echo base64_encode(readblob('somefile.bin'))
|
echo base64_encode(readblob('somefile.bin'))
|
||||||
" Encode a string
|
" Encode a string
|
||||||
echo base64_encode(list2blob(str2list(somestr)))
|
echo base64_encode(str2blob(somestr))
|
||||||
<
|
<
|
||||||
Can also be used as a |method|: >
|
Can also be used as a |method|: >
|
||||||
GetBinaryData()->base64_encode()
|
GetBinaryData()->base64_encode()
|
||||||
|
Reference in New Issue
Block a user