love.data.encode

Available since LÖVE 11.0
This function is not supported in earlier versions.


Encode Data or a string to a Data or string in one of the EncodeFormats.

Function

Synopsis

encoded = love.data.encode( container, format, sourceString, linelength )

Arguments

ContainerType container
What type to return the encoded data as.
EncodeFormat format
The format of the output data.
string sourceString
The raw data to encode.
number linelength (0)
The maximum line length of the output. Only supported for base64, ignored if 0.

Returns

value encoded
ByteData/string which contains the encoded version of source.

Function

Synopsis

encoded = love.data.encode( container, format, sourceData, linelength )

Arguments

ContainerType container
What type to return the encoded data as.
EncodeFormat format
The format of the output data.
Data sourceData
The raw data to encode.
number linelength (0)
The maximum line length of the output. Only supported for base64, ignored if 0.

Returns

value encoded
ByteData/string which contains the encoded version of source.

See Also

Other Languages