Buffer to string conversion

Buffer can be converted to a string (with the default UTF8 decoder) using the standard Lua function tostring().

Please use the Buffer:encode() method to convert the Buffer binary data with another encoding.

Example

-- create a Buffer from string encoded with base64 local buff = sys.Buffer("TMO7w6Q=", "base64") -- outputs true print(tostring(buff) == "L��"