diff --git a/apps/gipy_uploader/pkg/gpconv.d.ts b/apps/gipy_uploader/pkg/gpconv.d.ts index 9ded6a888..e97d230c3 100644 --- a/apps/gipy_uploader/pkg/gpconv.d.ts +++ b/apps/gipy_uploader/pkg/gpconv.d.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * @param {string} input_str -* @returns {string} +* @returns {Uint8Array} */ -export function convert_gpx_strings(input_str: string): string; +export function convert_gpx_strings(input_str: string): Uint8Array; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; diff --git a/apps/gipy_uploader/pkg/gpconv.js b/apps/gipy_uploader/pkg/gpconv.js index 7a9d8a777..58b6d4f26 100644 --- a/apps/gipy_uploader/pkg/gpconv.js +++ b/apps/gipy_uploader/pkg/gpconv.js @@ -74,16 +74,12 @@ function getInt32Memory0() { return cachedInt32Memory0; } -const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); - -cachedTextDecoder.decode(); - -function getStringFromWasm0(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); +function getArrayU8FromWasm0(ptr, len) { + return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); } /** * @param {string} input_str -* @returns {string} +* @returns {Uint8Array} */ export function convert_gpx_strings(input_str) { try { @@ -93,10 +89,11 @@ export function convert_gpx_strings(input_str) { wasm.convert_gpx_strings(retptr, ptr0, len0); var r0 = getInt32Memory0()[retptr / 4 + 0]; var r1 = getInt32Memory0()[retptr / 4 + 1]; - return getStringFromWasm0(r0, r1); + var v1 = getArrayU8FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1); + return v1; } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(r0, r1); } } diff --git a/apps/gipy_uploader/pkg/gpconv_bg.wasm b/apps/gipy_uploader/pkg/gpconv_bg.wasm index cf24562a3..f71a5c38c 100644 Binary files a/apps/gipy_uploader/pkg/gpconv_bg.wasm and b/apps/gipy_uploader/pkg/gpconv_bg.wasm differ