From d35db358c710e0799dd1bcd3a574cb0975ff2c45 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Wed, 12 Apr 2000 10:06:58 +0000 Subject: [PATCH] Provided implementation for the file fixup work. git-svn-id: svn://10.0.0.236/trunk@65692 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 415e8523427..3c9724f130d 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2332,7 +2332,19 @@ NS_IMETHODIMP nsDocShell::FileURIFixup(const PRUnichar* aStringURI, nsAutoString uriSpec(aStringURI); ConvertFileToStringURI(uriSpec, uriSpec); - return NS_OK; + + if(0 == uriSpec.Find("file:", 0)) + { + // if this is file url, we need to convert the URI + // from Unicode to the FS charset + nsCAutoString inFSCharset; + NS_ENSURE_SUCCESS(ConvertStringURIToFileCharset(uriSpec, inFSCharset), + NS_ERROR_FAILURE); + + if(NS_SUCCEEDED(NS_NewURI(aURI, inFSCharset.GetBuffer(), nsnull))) + return NS_OK; + } + return NS_ERROR_FAILURE; } #define FILE_PROTOCOL "file://"