From 16a7b05df679df80f2a09923b64baee42fb95fd6 Mon Sep 17 00:00:00 2001 From: "masayuki%d-toybox.com" Date: Thu, 28 Jul 2005 14:48:52 +0000 Subject: [PATCH] Bug 300183 Cannot attach the web page that its URL is encoded by non-UTF-8 URL encode r=jshin, sr=mscott, a=benjamin --- mailnews/compose/src/nsMsgCompose.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp index 683fca3934a4..01890654977f 100644 --- a/mailnews/compose/src/nsMsgCompose.cpp +++ b/mailnews/compose/src/nsMsgCompose.cpp @@ -3701,11 +3701,14 @@ nsresult nsMsgCompose::AttachmentPrettyName(const char* scheme, const char* char const char* cset = (!charset || !*charset) ? "UTF-8" : charset; rv = utf8Cvt->ConvertURISpecToUTF8(nsDependentCString(scheme), cset, utf8Scheme); - NS_ENSURE_SUCCESS(rv, rv); - // Some ASCII characters still need to be escaped. - NS_UnescapeURL(utf8Scheme.get(), utf8Scheme.Length(), - esc_SkipControl | esc_AlwaysCopy, _retval); + if (NS_SUCCEEDED(rv)) { + // Some ASCII characters still need to be escaped. + NS_UnescapeURL(utf8Scheme.get(), utf8Scheme.Length(), + esc_SkipControl | esc_AlwaysCopy, _retval); + } else { + _retval.Assign(scheme); + } if (PL_strncasestr(scheme, "http:", 5)) _retval.Cut(0, 7);