diff --git a/apps/gipy_uploader/pkg/gpconv.d.ts b/apps/gipy_uploader/pkg/gpconv.d.ts index e97d230c3..9ded6a888 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 {Uint8Array} +* @returns {string} */ -export function convert_gpx_strings(input_str: string): Uint8Array; +export function convert_gpx_strings(input_str: string): string; 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 58b6d4f26..7a9d8a777 100644 --- a/apps/gipy_uploader/pkg/gpconv.js +++ b/apps/gipy_uploader/pkg/gpconv.js @@ -74,12 +74,16 @@ function getInt32Memory0() { return cachedInt32Memory0; } -function getArrayU8FromWasm0(ptr, len) { - return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); +const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +function getStringFromWasm0(ptr, len) { + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } /** * @param {string} input_str -* @returns {Uint8Array} +* @returns {string} */ export function convert_gpx_strings(input_str) { try { @@ -89,11 +93,10 @@ 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]; - var v1 = getArrayU8FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - return v1; + return getStringFromWasm0(r0, r1); } 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 f71a5c38c..cf24562a3 100644 Binary files a/apps/gipy_uploader/pkg/gpconv_bg.wasm and b/apps/gipy_uploader/pkg/gpconv_bg.wasm differ