Buffer to string conversion
Buffer can be converted to a string using the standard Lua function tostring().
Please use the
Buffer:encode() method to convert the Buffer data with another encoding, or change the Buffer encoding.
Example
-- create a Buffer from string encoded with base64
local buff = sys.Buffer("TMO7w6Q=", "base64")
-- outputs true
print(tostring(buff:encode('utf8')) == "Lûä")