From 8b1af3fb93dceea78f251dd1238baa46c4f1a839 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. --- docshell/base/nsDocShell.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 415e85234276..3c9724f130d7 100644 --- a/docshell/base/nsDocShell.cpp +++ b/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://"