Hi, I'm sending this mail to inform you of the removal of some methods from our string classes. These functions will mostly be removed over the next weeks; those that aren't should be considered deprecated and not be used in newly written code.
Note that this will not affect Mozilla 1.7.x, nor Firefox 1.0.
These functions are going away (some of those are already gone on current CVS):
nsString::IsASCII
Use the global IsASCII function (from nsReadableUtils.h), or
nsCRT::IsASCII if you have a PRUnichar*.
nsString::IsSpace Use nsCRT::IsAsciiSpace. It has the same signature and works in exactly the same way.
All *WithConversion members of the string classes. Instead of AssignWithConversion and AppendWithConversion, use AssignASCII or AssignLiteral, and AppendASCII or AppendLiteral. If the string you are appending is not limited to ASCII, *WithConversion did the wrong thing anyway. You can use functions like NS_CopyUnicodeToNative (for filenames), CopyUTF16toUTF8, LossyCopyUTF16toASCII, AppendUTF8toUTF16, etc.
EqualsWithConversion can be replaced by EqualsASCII.
nsString::InsertWithConversion will be removed, use Insert with an appropriate NS_ConvertXtoY function, or concatenate strings if possible.
EqualsIgnoreCase will also be removed, use LowerCaseEqualsLiteral / LowerCaseEqualsASCII if the second string is known to be a lower-case literal or ASCII string; or .Equals(other_string, nsCaseInsensitiveCStringComparator()) otherwise.
nsCString::Compare will also be removed. Use the global Compare function. I.e., some_cstring.Compare(some_char_pointer) can be replaced by Compare(some_cstring, nsDependentCString(some_char_pointer)). However, if you were only wanting to check for equality, use some_cstring.Equals(some_char_pointer) instead.
These functions are being eliminated because they are not safe for use with non-ascii characters.
See also http://www.mozilla.org/projects/xpcom/string-guide.html#Unicode_Conversion
-biesi
_______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
