Blob.CopyFrom Method,Type default not Unicode

Opus Manual:
As well as copying from another Blob , you can use this method to initialise a Blob from a string. By default the Blob will be set to the Unicode form of the string; if you pass "utf8" as the second parameter it will initialise the Blob with the UTF8-encoded form of the string.

set blob1 = dopus.create.blob
set blob2 = dopus.create.blob
set blob3 = dopus.create.blob


blob1.copyfrom "test","utf8"
dopus.output "blob1: " & join(blob1.tovbarray)
blob2.copyfrom "test"
dopus.output "blob2: " & join(blob2.tovbarray)
dopus.output "utf16: " &join(dopus.create.stringtools.encode("test", "utf16").tovbarray)

Result

blob1: 116 101 115 116
blob2: 116 101 115 116
utf16: 116 0 101 0 115 0 116 0
1 Like

Thanks for reporting this! A fix will be in 12.26.2.