fixes bug 142870 "nsIFile should use UCS-2 instead of UTF-8"

r=dougt sr=alecf
This commit is contained in:
darin@netscape.com
2002-05-07 23:07:19 +00:00
parent 29c5a27aa3
commit 09c17695e3
80 changed files with 585 additions and 812 deletions

View File

@@ -304,12 +304,12 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
nsCOMPtr<nsILocalFile> currentFile = do_CreateInstance("@mozilla.org/file/local;1");
if (currentFile && !defaultName.IsEmpty()) {
result = currentFile->InitWithPath(NS_ConvertUCS2toUTF8(defaultName));
result = currentFile->InitWithPath(defaultName);
if (NS_SUCCEEDED(result)) {
nsCAutoString leafName;
nsAutoString leafName;
currentFile->GetLeafName(leafName);
if (!leafName.IsEmpty()) {
filePicker->SetDefaultString(NS_ConvertUTF8toUCS2(leafName).get());
filePicker->SetDefaultString(leafName.get());
}
// set directory
@@ -335,11 +335,10 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
nsCOMPtr<nsILocalFile> localFile;
result = filePicker->GetFile(getter_AddRefs(localFile));
if (localFile) {
nsCAutoString unicodePath;
nsAutoString unicodePath;
result = localFile->GetPath(unicodePath);
if (!unicodePath.IsEmpty()) {
NS_ConvertUTF8toUCS2 pathName(unicodePath);
mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, pathName);
mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, unicodePath);
return NS_OK;
}
}