The WebGPU spec expects GPUCompilationMessage.linePos/offset/length to be in UTF-16 (source). That makes perfect sense for JavaScript where all strings are UTF-16, including the WGSL strings.
In the case of wasm/wasi we don't know what language the user is going to be using, so assuming UTF-16 seems like a bad idea.
webgpu.h and wgpu both just use bytes (i.e. UTF-8 code units) instead. Should we opt for bytes as well?
The WebGPU spec expects
GPUCompilationMessage.linePos/offset/lengthto be in UTF-16 (source). That makes perfect sense for JavaScript where all strings are UTF-16, including the WGSL strings.In the case of wasm/wasi we don't know what language the user is going to be using, so assuming UTF-16 seems like a bad idea.
webgpu.h and wgpu both just use bytes (i.e. UTF-8 code units) instead. Should we opt for bytes as well?