Closed
Bug 298820
Opened 20 years ago
Closed 20 years ago
nsIScriptableUConv should use ACString
Categories
(Core :: Internationalization, defect)
Core
Internationalization
Tracking
()
RESOLVED
FIXED
mozilla1.8beta3
People
(Reporter: Biesinger, Assigned: Biesinger)
Details
Attachments
(1 file)
|
4.18 KB,
patch
|
jshin1987
:
review+
darin.moz
:
superreview+
benjamin
:
approval1.8b3+
|
Details | Diff | Splinter Review |
it would be nice if nsIScriptableUnicodeConverter would use ACString in its
signatures, so that if someone actually can get hold of a string with null
bytes, they can convert it successfully.
This does not affect JS compatibility.
| Assignee | ||
Comment 1•20 years ago
|
||
Attachment #187344 -
Flags: review?(jshin1987)
| Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta3
Comment 2•20 years ago
|
||
Comment on attachment 187344 [details] [diff] [review]
patch
r=jshin
thanks !
ConvertFromByteArray(NS_REINTERPRET_CAST(const PRUint8*, aSrc),
>- strlen(aSrc),
>+ nsACString::const_iterator i;
>+ aSrc.BeginReading(i);
>+ return ConvertFromByteArray(NS_REINTERPRET_CAST(const PRUint8*, i.get()),
>+ aSrc.Length(),
> _retval);
How about using darin's idiom? :-)
const PRUint8* i =
NS_REINTERPRET_CAST(const PRUint8*, aSrc.BeginReading());
ConvertFromByteArray(i, aSrc.Length(), _retval);
Attachment #187344 -
Flags: review?(jshin1987) → review+
| Assignee | ||
Comment 3•20 years ago
|
||
Comment on attachment 187344 [details] [diff] [review]
patch
NS_REINTERPRET_CAST(const PRUint8*, aSrc.BeginReading());
I'd love to, but that requires an nsCString, not an nsACString.
Attachment #187344 -
Flags: superreview?(darin)
Comment 4•20 years ago
|
||
Comment on attachment 187344 [details] [diff] [review]
patch
You could optimize this code to avoid the buffer copies by using SetLength +
BeginWriting on nsACString, but I'm not sure it's worth it.
sr=darin
Attachment #187344 -
Flags: superreview?(darin) → superreview+
| Assignee | ||
Comment 5•20 years ago
|
||
Comment on attachment 187344 [details] [diff] [review]
patch
yeah, not sure either. maybe as a followup patch.
Low risk patch to change the type accepted by a function to allow passing all
kinds of binary data.
Attachment #187344 -
Flags: approval1.8b3?
Updated•20 years ago
|
Attachment #187344 -
Flags: approval1.8b3? → approval1.8b3+
| Assignee | ||
Comment 6•20 years ago
|
||
Checking in intl/uconv/idl/nsIScriptableUConv.idl;
/cvsroot/mozilla/intl/uconv/idl/nsIScriptableUConv.idl,v <--
nsIScriptableUConv.idl
new revision: 1.10; previous revision: 1.9
done
Checking in intl/uconv/src/nsScriptableUConv.cpp;
/cvsroot/mozilla/intl/uconv/src/nsScriptableUConv.cpp,v <-- nsScriptableUConv.cpp
new revision: 1.17; previous revision: 1.16
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•