Closed Bug 1331298 Opened 3 years ago Closed 3 years ago
[jsplugins] Support |\u 4 hexadecimal digits| format in json in rpc
+++ This bug was initially created as a clone of Bug #1325896 +++ We need to implement PPB_KeyboardInputEvent_Create for "backspace" and "escape". We found that "ESC" would be passing into rpc as |\u 4 hexadecimal digits| in json. Currently, our rpc only recognize |\u0000| but the rest of characters that use this format. We would need to support this format at least for "ESC".
Component: General → Plug-ins
Product: Firefox → Core
Hey Peter, Could you help with this patch? This patch is a quick fix for "Esc" which only handles unicode character escape sequence for "ESC". However, we probably need to do some studies to know if we need to fully support |\u 4 hexadecimal digits| json format. Thank you very much.
So, Ecmascript specifies that stringify outputs \uxxxx for characters with a "value less than the space character", so 0000 to 001F. You could check for |*(next + 1) == '0'| and |*(next + 2) == '0'| and then convert using strtol for example.
Hey peter, This patch supports escape sequence from U+0000 to U+001F in rpc.h when we parse JSON to string. Could you take a look at it? thanks
Attachment #8837959 - Flags: review?(peterv) → review+
Result of try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6f9cb3f4f8ff9ee908e8c29ba0c220ad306b0df8
Attachment #8837959 - Attachment is obsolete: true
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/dc335045a33b Handle Control characters code units from U+0000 to U+001F in rpc.h. r=peterv
You need to log in before you can comment on or make changes to this bug.