Sets the text buffer value, interpreted using encoding, as the result.
When SQLite no longer needs value, it invokes cleanup.