Closed Bug 1331298 Opened 3 years ago Closed 3 years ago

[jsplugins] Support |\u 4 hexadecimal digits| format in json in rpc

Categories

(Core :: Plug-ins, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ywu, Assigned: ywu)

References

Details

Attachments

(1 file, 2 obsolete files)

+++ 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".
Assignee: nobody → ywu
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.
Attachment #8830596 - Flags: review?(peterv)
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 #8830596 - Attachment is obsolete: true
Attachment #8830596 - Flags: review?(peterv)
Attachment #8837959 - Flags: review?(peterv)
Attachment #8837959 - Flags: review?(peterv) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
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
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dc335045a33b
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.