Skip to content

Commit

Permalink
Fix: From Buffer to TextEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
carlopi committed Jun 17, 2024
1 parent b9cc722 commit 3cd6178
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/duckdb-wasm/src/bindings/bindings_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export abstract class DuckDBBindingsBase implements DuckDBBindings {

/** Send a query and return the full result */
public runQuery(conn: number, text: string): Uint8Array {
const BUF = Buffer.from(text);
let encoder = new TextEncoder();
const BUF = encoder.encode(text);
const bufferPtr = this.mod._malloc(BUF.length );
const bufferOfs = this.mod.HEAPU8.subarray(bufferPtr, bufferPtr + BUF.length );
bufferOfs.set(BUF);
Expand Down

0 comments on commit 3cd6178

Please sign in to comment.