runtime(doc): update and correct str2blob() and blob2str() examples

closes: #16952

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2025-03-23 10:20:20 +01:00
committed by Christian Brabandt
parent e14aa3c035
commit 932a535bfa

View File

@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2025 Mar 18 *builtin.txt* For Vim version 9.1. Last change: 2025 Mar 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1323,9 +1323,11 @@ blob2str({blob} [, {options}]) *blob2str()*
See also |str2blob()| See also |str2blob()|
Examples: > Examples: >
blob2str(0z6162) returns ["ab"] blob2str(0z6162) returns ['ab']
blob2str(0zC2ABC2BB) returns ["«»"] blob2str(0zC2ABC2BB) returns ['«»']
blob2str(0zABBB, {'encoding': 'latin1'}) returns ["«»"] blob2str(0z610A62) returns ['a', 'b']
blob2str(0z610062) returns ['a\nb']
blob2str(0zABBB, {'encoding': 'latin1'}) returns ['«»']
< <
Can also be used as a |method|: > Can also be used as a |method|: >
GetBlob()->blob2str() GetBlob()->blob2str()
@ -10668,9 +10670,10 @@ str2blob({list} [, {options}]) *str2blob()*
Examples: > Examples: >
str2blob(["ab"]) returns 0z6162 str2blob(["ab"]) returns 0z6162
str2blob(["«»"]) returns 0zC2ABC2BB str2blob(["«»"]) returns 0zC2ABC2BB
str2blob(["a\nb"]) returns 0z610A62 str2blob(["a\nb"]) returns 0z610062
str2blob(readfile('myfile.txt')) str2blob(["a","b"]) returns 0z610A62
str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB
str2blob(readfile('myfile.txt'))
< <
Can also be used as a |method|: > Can also be used as a |method|: >
GetListOfStrings()->str2blob() GetListOfStrings()->str2blob()