Skip to content

RawData.setUtf8

JoeStrout edited this page Apr 29, 2026 · 2 revisions

write a UTF-8 string at the given byte offset; returns bytes written

Parameters

Parameter Default Value Note
offset 0
value ""

Return value

Condition Return Value
(always) number

Notes

Example

import "RawData"
data = new RawData
data.resize 16
bytesWritten = data.setUtf8(0, "hello")
print bytesWritten   // 5
print data.utf8(0, 5)   // "hello"

Clone this wiki locally