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>
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 10970bc..9ba22dc 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -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
@@ -1244,7 +1244,7 @@
" Write the decoded contents to a binary file
call writefile(base64_decode(s), 'tools.bmp')
" Decode a base64-encoded string
- echo list2str(blob2list(base64_decode(encodedstr)))
+ echo blob2str(base64_decode(encodedstr))
<
Can also be used as a |method|: >
GetEncodedString()->base64_decode()
@@ -1260,7 +1260,7 @@
" Encode the contents of a binary file
echo base64_encode(readblob('somefile.bin'))
" Encode a string
- echo base64_encode(list2blob(str2list(somestr)))
+ echo base64_encode(str2blob(somestr))
<
Can also be used as a |method|: >
GetBinaryData()->base64_encode()