mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 09:30:44 +00:00
Use nsString::AssignWithConversion to build nsStrings from char strings.
This commit is contained in:
parent
8b9ed74a88
commit
506d08959e
@ -102,13 +102,13 @@ void UMacUnicode::Str255ToString(const Str255& aStr255, nsString& aText)
|
||||
PRInt32 outLength = 512;
|
||||
rv = gUnicodeDecoder->Convert((char *) &aStr255[1], &inLength, buffer, &outLength);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
aText.SetString(buffer, outLength);
|
||||
aText.Assign(buffer, outLength);
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
// NS_ASSERTION(0, "error: charset covnersion");
|
||||
aText.SetString((char *) &aStr255[1], aStr255[0]);
|
||||
aText.AssignWithConversion((char *) &aStr255[1], aStr255[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ static void GetFileSystemCharset(nsString & fileSystemCharset)
|
||||
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "error getting platform charset");
|
||||
if (NS_FAILED(rv))
|
||||
aCharset.SetString("x-mac-roman");
|
||||
aCharset.AssignWithConversion("x-mac-roman");
|
||||
}
|
||||
fileSystemCharset = aCharset;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user