[API reference](https://evolu.dev/docs/api-reference) › [@evolu/sqlite-wasm](https://evolu.dev/docs/api-reference/sqlite-wasm) › allocCString

```ts
function allocCString(
  deps: SqliteWasmDep,
): (value: string) => Result<SqliteOwnedCStringPtr, SqliteNoMemError>;
```

Defined in: [packages/sqlite-wasm/src/Memory.ts:67](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/sqlite-wasm/src/Memory.ts#L67)

Copies a string into new memory as a NUL-terminated UTF-8 C string, which the
caller frees with `sqlite3_free`.

UTF-8 cannot encode a lone surrogate, which becomes U+FFFD, as with
`TextEncoder`, so a caller that needs the exact text checks
`String.prototype.isWellFormed` first.