From 2675d243793c7dfe48231a0f0ce69e7082b0428d Mon Sep 17 00:00:00 2001 From: "nhotta%netscape.com" Date: Tue, 8 Oct 2002 23:19:03 +0000 Subject: [PATCH] Changed to unescape the tab title with a charset if non ASCII, bug 158171, r=caillon, sr=bzbarsky. git-svn-id: svn://10.0.0.236/trunk@131492 18797224-902f-48f8-a5cc-f745e15eee43 --- .../resources/content/bindings/tabbrowser.xml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml b/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml index 13a8358ce8c..d4dfe5d4816 100644 --- a/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml +++ b/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml @@ -559,9 +559,23 @@ } } - if (title && title != "about:blank") + if (title && title != "about:blank") { + // At this point, we now have a URI. + // Let's try to unescape it using a character set + // in case the URI is not ASCII. + try { + var characterSet = Components.lookupMethod(browser.contentDocument, 'characterSet') + .call(browser.contentDocument); + const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] + .getService(Components.interfaces.nsITextToSubURI); + title = textToSubURI.unEscapeNonAsciiURI(characterSet, title); + } + catch(ex) { + // Do nothing. + } + crop = "center"; - else // Still no title? Fall back to our untitled string. + } else // Still no title? Fall back to our untitled string. title = this.mStringBundle.getString("tabs.untitled"); }