Bug 339002 Last %-escaped character in URL disappears in status bar if page displayed as UTF-8. r=jshin, sr=roc

This commit is contained in:
smontagu%smontagu.org 2006-05-28 05:39:25 +00:00
Родитель 516b8bd1cc
Коммит 9c7ef81bef
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -233,8 +233,11 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeURIForUI(const nsACString & aCharset,
esc_SkipControl | esc_AlwaysCopy, unescapedSpec);
// in case of failure, return escaped URI
if (NS_FAILED(convertURItoUnicode(
PromiseFlatCString(aCharset), unescapedSpec, PR_TRUE, _retval)))
// Test for != NS_OK rather than NS_FAILED, because incomplete multi-byte
// sequences are also considered failure in this context
if (convertURItoUnicode(
PromiseFlatCString(aCharset), unescapedSpec, PR_TRUE, _retval)
!= NS_OK)
// assume UTF-8 instead of ASCII because hostname (IDN) may be in UTF-8
CopyUTF8toUTF16(aURIFragment, _retval);
return NS_OK;