Re: [w3c/uievents] Clarify `keypress` event handling for keys that map to non-BMP Unicode symbols (Issue #346)

> > Chrome and Firefox are simply buggy, they are sending invalid incorrect strings.
> 
> No, `.charCode` is not a `String`, it's `unsigned long`. That makes the things complicated. For appending it to a `String` object, it requires to call `String.fromCharCode` instead of `+=`. If it were `String`, just fixing in Firefox and Chrome must have been fine and no risk.

Can you clarify what you mean? I might be misunderstanding. Turning a numeric UTF-16 code unit into a string requires `String.fromCharCode`, regardless of whether astral symbols / surrogate pairs are at play.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/346#issuecomment-1570215465
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/uievents/issues/346/1570215465@github.com>

Received on Wednesday, 31 May 2023 13:15:03 UTC