Closed
Bug 290914
Opened 19 years ago
Closed 19 years ago
[FIXr]Implement nsBinaryOutputStream::WriteUtf8Z
Categories
(Core :: XPCOM, defect, P2)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file, 1 obsolete file)
1.30 KB,
patch
|
Biesinger
:
review+
darin.moz
:
superreview+
asa
:
approval1.8b2+
|
Details | Diff | Splinter Review |
It seems to be well-documented and not very implemented.
Assignee | ||
Comment 1•19 years ago
|
||
Assignee: dougt → bzbarsky
Status: NEW → ASSIGNED
Attachment #181113 -
Flags: superreview?(darin)
Attachment #181113 -
Flags: review?(darin)
Assignee | ||
Updated•19 years ago
|
Priority: -- → P2
Summary: Implement nsBinaryOutputStream::WriteUtf8Z → [FIX]Implement nsBinaryOutputStream::WriteUtf8Z
Target Milestone: --- → mozilla1.8beta3
Comment 2•19 years ago
|
||
Comment on attachment 181113 [details] [diff] [review] Patch r+sr=darin looks good. we need to freeze this interface too :-)
Attachment #181113 -
Flags: superreview?(darin)
Attachment #181113 -
Flags: superreview+
Attachment #181113 -
Flags: review?(darin)
Attachment #181113 -
Flags: review+
Comment 3•19 years ago
|
||
OK. how does this implementation match the interface which says: 79 * Write a NUL-terminated UTF8-encoded string to a binary stream, produced 80 * from a NUL-terminated 16-bit PRUnichar* string argument. 81 */ 82 void writeUtf8Z(in wstring aString); It does not look like the written string is actually nul-terminated, since str.Length() does not include the nul. Additionally, this implementation differs from the other string-writing ones, in that it does not write the length of the string to the stream. Of course, the interface does not talk about that at all... As it is, it seems to me like this implementation is inconsistent both with respect to the interface and the other implementations.
OS: Linux → All
Hardware: PC → All
Comment 4•19 years ago
|
||
hmm, yeah.. comparing the API specs for WriteStringZ, WriteWStringZ, and WriteUtf8Z, I'd have to agree with what you are saying. It seems to me that WriteUtf8Z should just call: WriteStringZ(NS_ConvertUTF16toUTF8(input).get()); That would seem to "Write a NUL-terminated [XXX] string to a binary stream" in a consistent manner. We should fixup the documentation to be more clear. We should also document the endianness of WriteWStringZ. These details are important if people are going to use these interfaces to manipulate binary data.
Assignee | ||
Comment 5•19 years ago
|
||
> WriteStringZ(NS_ConvertUTF16toUTF8(input).get()); Yeah, you're right.... Note that once this has been done, there's no way to read the string back out of the stream as Unicode, btw -- you have to readCString() and then convert from UTF8 to UTF16 yourself.... > We should also document the endianness of WriteWStringZ. The whole interface is documented as writing in big-endian for all types. Note that writing a "string" doesn't just write a string; this interface is not designed for generally manipulating binary data but for being used with nsIBinaryInputStream....
Assignee | ||
Comment 6•19 years ago
|
||
Attachment #181113 -
Attachment is obsolete: true
Attachment #181188 -
Flags: superreview?(darin)
Attachment #181188 -
Flags: review?(cbiesinger)
Updated•19 years ago
|
Attachment #181188 -
Flags: review?(cbiesinger) → review+
Updated•19 years ago
|
Attachment #181188 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 7•19 years ago
|
||
Comment on attachment 181188 [details] [diff] [review] Updated patch Requesting 1.8b2 approval, since this is sorta an api change -- we implement this method now. ;)
Attachment #181188 -
Flags: approval1.8b2?
Assignee | ||
Updated•19 years ago
|
Summary: [FIX]Implement nsBinaryOutputStream::WriteUtf8Z → [FIXr]Implement nsBinaryOutputStream::WriteUtf8Z
Comment 8•19 years ago
|
||
Comment on attachment 181188 [details] [diff] [review] Updated patch a=asa
Attachment #181188 -
Flags: approval1.8b2? → approval1.8b2+
Assignee | ||
Comment 9•19 years ago
|
||
Fixed
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.8beta3 → mozilla1.8beta2
You need to log in
before you can comment on or make changes to this bug.
Description
•