Bug 1070986 - React to the removal of us-ascii as a Gecko-canonical name (map us-ascii to windows-1252). r=jcranmer, a=mkmelin
Landing string changes on CLOSED TREE for seamonkey
This commit is contained in:
Родитель
30d62c8b1d
Коммит
07a392ed4e
|
@ -75,8 +75,6 @@ var gManualAttachmentReminder;
|
|||
var gComposeType;
|
||||
|
||||
// i18n globals
|
||||
var gSendDefaultCharset;
|
||||
var gCharsetTitle;
|
||||
var gCharsetConvertManager;
|
||||
var _gComposeBundle;
|
||||
function getComposeBundle() {
|
||||
|
@ -123,8 +121,6 @@ function InitializeGlobalVariables()
|
|||
gCloseWindowAfterSave = false;
|
||||
gSavedSendNowKey = null;
|
||||
gSendFormat = nsIMsgCompSendFormat.AskUser;
|
||||
gSendDefaultCharset = null;
|
||||
gCharsetTitle = null;
|
||||
gCharsetConvertManager = Components.classes['@mozilla.org/charset-converter-manager;1'].getService(Components.interfaces.nsICharsetConverterManager);
|
||||
gHideMenus = false;
|
||||
gManualAttachmentReminder = false;
|
||||
|
@ -2407,7 +2403,6 @@ function SetDocumentCharacterSet(aCharset)
|
|||
{
|
||||
if (gMsgCompose) {
|
||||
gMsgCompose.SetDocumentCharset(aCharset);
|
||||
gCharsetTitle = null;
|
||||
SetComposeWindowTitle();
|
||||
}
|
||||
else
|
||||
|
@ -2416,50 +2411,17 @@ function SetDocumentCharacterSet(aCharset)
|
|||
|
||||
function GetCharsetUIString()
|
||||
{
|
||||
var charset = gMsgCompose.compFields.characterSet;
|
||||
if (gSendDefaultCharset == null) {
|
||||
gSendDefaultCharset = gMsgCompose.compFields.defaultCharacterSet;
|
||||
}
|
||||
|
||||
charset = charset.toUpperCase();
|
||||
if (!charset || charset == "US-ASCII")
|
||||
charset = "ISO-8859-1";
|
||||
|
||||
if (charset != gSendDefaultCharset) {
|
||||
|
||||
if (gCharsetTitle == null) {
|
||||
try {
|
||||
// check if we have a converter for this charset
|
||||
var charsetAlias = gCharsetConvertManager.getCharsetAlias(charset);
|
||||
var encoderList = gCharsetConvertManager.getEncoderList();
|
||||
var found = false;
|
||||
while (encoderList.hasMore()) {
|
||||
if (charsetAlias == encoderList.getNext()) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
dump("no charset converter available for " + charset + " default charset is used instead\n");
|
||||
// set to default charset, no need to show it in the window title
|
||||
gMsgCompose.compFields.characterSet = gSendDefaultCharset;
|
||||
return "";
|
||||
}
|
||||
|
||||
// get a localized string
|
||||
gCharsetTitle = gCharsetConvertManager.getCharsetTitle(charsetAlias);
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to get a charset title of " + charset + "!\n");
|
||||
dump("Exception: " + ex + "\n");
|
||||
gCharsetTitle = charset; // just show the charset itself
|
||||
}
|
||||
// The charset here is already the canonical charset (not an alias).
|
||||
let charset = gMsgCompose.compFields.characterSet;
|
||||
if (charset && charset != gMsgCompose.compFields.defaultCharacterSet) {
|
||||
try {
|
||||
return " - " + gCharsetConvertManager.getCharsetTitle(charset);
|
||||
}
|
||||
catch(e) { // Not a canonical charset after all...
|
||||
Components.utils.reportError("Not charset title for charset=" + charset);
|
||||
return " - " + charset;
|
||||
}
|
||||
|
||||
return " - " + gCharsetTitle;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
## charset_name.title = a_title - specifies the human readable title for
|
||||
## this charset
|
||||
|
||||
us-ascii.title = English (US-ASCII)
|
||||
iso-8859-1.title = Western (ISO-8859-1)
|
||||
iso-8859-2.title = Central European (ISO-8859-2)
|
||||
iso-8859-3.title = South European (ISO-8859-3)
|
||||
|
|
|
@ -2680,7 +2680,7 @@ nsMsgComposeAndSend::InitCompositionFields(nsMsgCompFields *fields,
|
|||
// Make sure charset is sane...
|
||||
if (!cset || !*cset)
|
||||
{
|
||||
mCompFields->SetCharacterSet("us-ascii");
|
||||
mCompFields->SetCharacterSet("UTF-8");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ int32_t nsMsgSendPart::M_counter = 0;
|
|||
|
||||
nsMsgSendPart::nsMsgSendPart(nsIMsgSend* state, const char *part_charset)
|
||||
{
|
||||
PL_strncpy(m_charset_name, (part_charset ? part_charset : "us-ascii"), sizeof(m_charset_name)-1);
|
||||
PL_strncpy(m_charset_name, (part_charset ? part_charset : "UTF-8"), sizeof(m_charset_name)-1);
|
||||
m_charset_name[sizeof(m_charset_name)-1] = '\0';
|
||||
m_children = nullptr;
|
||||
m_numchildren = 0;
|
||||
|
|
|
@ -29,7 +29,6 @@ replacement.isInternal = true
|
|||
t.61-8bit.notForOutgoing = true
|
||||
utf-7.notForOutgoing = true
|
||||
x-imap4-modified-utf7.notForOutgoing = true
|
||||
us-ascii.notForOutgoing = true
|
||||
ibm1125.notForOutgoing = true
|
||||
ibm1131.notForOutgoing = true
|
||||
iso-8859-8.notForOutgoing = true
|
||||
|
@ -92,7 +91,6 @@ koi8-r.LangGroup = x-cyrillic
|
|||
koi8-u.LangGroup = x-cyrillic
|
||||
shift_jis.LangGroup = ja
|
||||
windows-874.LangGroup = th
|
||||
us-ascii.LangGroup = x-western
|
||||
t.61-8bit.LangGroup = x-western
|
||||
utf-8.LangGroup = x-unicode
|
||||
utf-16.LangGroup = x-unicode
|
||||
|
|
|
@ -13,10 +13,7 @@
|
|||
# labelsencodings.properties. Besides aliases it contains labels for charsets
|
||||
# that are not part of the HTML5 world, but still are supported for e-mail.
|
||||
|
||||
ascii=us-ascii
|
||||
us-ascii=us-ascii
|
||||
ansi_x3.4-1968=us-ascii
|
||||
646=us-ascii
|
||||
646=windows-1252
|
||||
iso-8859-1=ISO-8859-1
|
||||
utf-16=UTF-16
|
||||
utf-7=UTF-7
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
## charset_name.title = a_title - specifies the human readable title for
|
||||
## this charset
|
||||
|
||||
us-ascii.title = English (US-ASCII)
|
||||
iso-8859-1.title = Western (ISO-8859-1)
|
||||
iso-8859-2.title = Central European (ISO-8859-2)
|
||||
iso-8859-3.title = South European (ISO-8859-3)
|
||||
|
|
Загрузка…
Ссылка в новой задаче