JSStringGetUTF8CString(_:_:_:)
Converts a JavaScript string into a null-terminated UTF-8 string, and copies the result into an external byte buffer.
Declaration
func JSStringGetUTF8CString(_ string: JSStringRef!, _ buffer: UnsafeMutablePointer<CChar>!, _ bufferSize: Int) -> IntParameters
- string:
The source Jsstringref.
- buffer:
The destination byte buffer to copy a null-terminated UTF-8 representation of
stringinto. On return,buffercontains a UTF-8 string representation ofstring. IfbufferSizeis too small,buffercontains only partial results. Ifbufferisn’t at leastbufferSizebytes in size, the conversion results in undefined behavior. - bufferSize:
The size of the external buffer in bytes.
Return Value
The number of bytes the system writes into buffer (including the null-terminator byte).