Closed Bug 213035 Opened 21 years ago Closed 21 years ago

replace NS_ConvertUTF8toUCS2 with IsUTF8 for UTF8-ness checking

Categories

(MailNews Core :: MIME, defect)

defect
Not set
minor

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jshin1987, Assigned: sspitzer)

Details

Attachments

(1 file, 1 obsolete file)

This is just to make debugging a bit easy. Currently, NS_ConvertUTF8toUCS2 is
invoked just to check if a string is a valid UTF-8 string. Now that we have
IsUTF8, we'd better use it. With that, we get assertions where invalid strings
are used (in mailnews/mime/src) instead of string/public/nsUTF8Utils.h
Attached patch patch (obsolete) — Splinter Review
How about changing:

#ifdef DEBUG
if (foo)
  NS_ASSERTION(something, "")
#endif

To:

NS_ASSERTION(!foo || something, "");
Attached patch simplified patchSplinter Review
Yup, I realized that right after uploading attachment 127994 [details] [diff] [review].
Attachment #127994 - Attachment is obsolete: true
Comment on attachment 127996 [details] [diff] [review]
simplified patch

asking for r/sr
Attachment #127996 - Flags: superreview?(bzbarsky)
Attachment #127996 - Flags: review?(sspitzer)
Comment on attachment 127996 [details] [diff] [review]
simplified patch

Excellent. sr=me.
Attachment #127996 - Flags: superreview?(bzbarsky) → superreview+
Attachment #127996 - Flags: review?(sspitzer) → review?(bienvenu)
Comment on attachment 127996 [details] [diff] [review]
simplified patch

yes, thx.
Attachment #127996 - Flags: review?(bienvenu) → review+
Comment on attachment 127996 [details] [diff] [review]
simplified patch

thanks for r.
Now asking for 1.5b.

Risk : zero in opt. build  because I'm just changing  several NS_ASSERTION. 
Benefit : in debug build, assertion will be made where it's supposed to be made
instead of a far-away place(xpcom/string).
Attachment #127996 - Flags: approval1.5b?
Comment on attachment 127996 [details] [diff] [review]
simplified patch

a=asa (on behalf of drivers) for checkin to 1.5beta
Attachment #127996 - Flags: approval1.5b? → approval1.5b+
It looks like this landed on 8/26. Can this bug be resolved?
sorry for forgetting to mark as resolved.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Verified fixed using LXR as code inspection.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: