Skip to content

Commit e80f345

Browse files
h-eastchrisbra
authored andcommitted
runtime(doc): Tweak documentation about base64 function
closes: #16353 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 8dc98bf commit e80f345

1 file changed

Lines changed: 40 additions & 40 deletions

File tree

runtime/doc/builtin.txt

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2024 Dec 31
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -67,8 +67,8 @@ autocmd_get([{opts}]) List return a list of autocmds
6767
balloon_gettext() String current text in the balloon
6868
balloon_show({expr}) none show {expr} inside the balloon
6969
balloon_split({msg}) List split {msg} as used for a balloon
70-
base64_decode({string}) Blob base-64 decode {string} characters
71-
base64_encode({blob}) String base-64 encode the bytes in {blob}
70+
base64_decode({string}) Blob base64 decode {string} characters
71+
base64_encode({blob}) String base64 encode the bytes in {blob}
7272
bindtextdomain({package}, {path})
7373
Bool bind text domain to specified path
7474
blob2list({blob}) List convert {blob} into a list of numbers
@@ -1171,43 +1171,6 @@ autocmd_get([{opts}]) *autocmd_get()*
11711171
Return type: list<dict<any>>
11721172

11731173

1174-
base64_decode({string}) *base64_decode()*
1175-
Return a Blob containing the bytes decoded from the base64
1176-
characters in {string}.
1177-
1178-
The {string} argument should contain only base64-encoded
1179-
characters and should have a length that is a multiple of 4.
1180-
1181-
Returns an empty blob on error.
1182-
1183-
Examples: >
1184-
" Write the decoded contents to a binary file
1185-
call writefile(base64_decode(s), 'tools.bmp')
1186-
" Decode a base64-encoded string
1187-
echo list2str(blob2list(base64_decode(encodedstr)))
1188-
<
1189-
Can also be used as a |method|: >
1190-
GetEncodedString()->base64_decode()
1191-
<
1192-
Return type: |Blob|
1193-
1194-
1195-
base64_encode({blob}) *base64_encode()*
1196-
Return a base64-encoded String representing the bytes in
1197-
{blob}. The base64 alphabet defined in RFC 4648 is used.
1198-
1199-
Examples: >
1200-
" Encode the contents of a binary file
1201-
echo base64_encode(readblob('somefile.bin'))
1202-
" Encode a string
1203-
echo base64_encode(list2blob(str2list(somestr)))
1204-
<
1205-
Can also be used as a |method|: >
1206-
GetBinaryData()->base64_encode()
1207-
<
1208-
Return type: |String|
1209-
1210-
12111174
balloon_gettext() *balloon_gettext()*
12121175
Return the current text in the balloon. Only for the string,
12131176
not used for the List. Returns an empty string if balloon
@@ -1264,6 +1227,43 @@ balloon_split({msg}) *balloon_split()*
12641227

12651228
Return type: list<any> or list<string>
12661229

1230+
base64_decode({string}) *base64_decode()*
1231+
Return a Blob containing the bytes decoded from the base64
1232+
encoded characters in {string}.
1233+
1234+
The {string} argument should contain only base64-encoded
1235+
characters and should have a length that is a multiple of 4.
1236+
1237+
Returns an empty blob on error.
1238+
1239+
Examples: >
1240+
" Write the decoded contents to a binary file
1241+
call writefile(base64_decode(s), 'tools.bmp')
1242+
" Decode a base64-encoded string
1243+
echo list2str(blob2list(base64_decode(encodedstr)))
1244+
<
1245+
Can also be used as a |method|: >
1246+
GetEncodedString()->base64_decode()
1247+
<
1248+
Return type: |Blob|
1249+
1250+
1251+
base64_encode({blob}) *base64_encode()*
1252+
Return a base64-encoded String representing the bytes in
1253+
{blob}. The base64 alphabet defined in RFC 4648 is used.
1254+
1255+
Examples: >
1256+
" Encode the contents of a binary file
1257+
echo base64_encode(readblob('somefile.bin'))
1258+
" Encode a string
1259+
echo base64_encode(list2blob(str2list(somestr)))
1260+
<
1261+
Can also be used as a |method|: >
1262+
GetBinaryData()->base64_encode()
1263+
<
1264+
Return type: |String|
1265+
1266+
12671267
bindtextdomain({package}, {path}) *bindtextdomain()*
12681268
Bind a specific {package} to a {path} so that the
12691269
|gettext()| function can be used to get language-specific

0 commit comments

Comments
 (0)