Closed Bug 1487310 Opened 2 years ago Closed 2 years ago
UTF8To UTF16() in ns NSSCert Helper .cpp uselessly uses To New Unicode()
46 bytes, text/x-phabricator-request
|Details | Review|
LossyUTF8ToUTF16() in nsNSSCertHelper.cpp uses XPCOM string conversions in an awkward way. Instead of ToNewUnicode() + Adopt(), it should use strings in a regular non-Adopt() way.
This does not change the outward behavior of LossyUTF8ToUTF16(). Both ToNewUnicode() and CopyASCIItoUTF16() convert from Latin1 to UTF-16. MozReview-Commit-ID: 8SDgvoGaN4A
Aside: The original motivation in bug 1461037 was to avoid assertions when UTF-8 is bogus. Nowadays UTF-8 to UTF-16 conversion replaces errors with the REPLACEMENT CHARACTER instead of asserting.
Comment on attachment 9005109 [details] Bug 1487310 - Let XPCOM strings manage their own buffer in LossyUTF8ToUTF16(). Dana Keeler [:keeler] (she/her) (use needinfo) has approved the revision.
Attachment #9005109 - Flags: review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/c45b51ec248e Let XPCOM strings manage their own buffer in LossyUTF8ToUTF16(). r=keeler
You need to log in before you can comment on or make changes to this bug.