Closed Bug 1339959 Opened 9 years ago Closed 8 years ago

child_process wrapper fails when writing certain strings with multi-byte UTF-8 codepoints

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: arnarbi, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce: In an add-on, create a subprocess using the older wrappers in [1], and emit(child.stdin, 'data', x) where x is for example String.fromCharCode(150). [1] https://hg.mozilla.org/releases/mozilla-aurora/rev/a1e968b6978b The problem is in [2]. The buffer variable captures the 8-bit values as decoded from the original codepoints, whereas data is a UTF-8 string. Instead of writing buffer to the pipe, data is written. [2] https://hg.mozilla.org/releases/mozilla-aurora/rev/a1e968b6978b#l5.499 Actual results: The UTF-8 expansion of codepoint 150 gets written, which is 0xC2, 0x96. Expected results: The single 8-bit value 150 (=0x96) should have been written.
Component: Untriaged → General
Product: Firefox → Add-on SDK
Version: Trunk → unspecified
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.