Bug 1512977 - Part 1: Remove charset aliases for unsupported x-mac-NNNNN and MUTF-7, remove hard-coded x-windows-949. r=hsivonen a=jorgk
authorJorg K <jorgk@jorgk.com>
Tue, 11 Dec 2018 23:01:41 +0100
changeset 33875 e2a06105446af2ccbcad99fc49b90e607ca07208
parent 33874 a2bd632a970bd5cd9988a6ba3812a0e09cbbd22b
child 33876 5a1af52c188e4c092576ff67bef9d5dbc07bb265
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewershsivonen, jorgk
bugs1512977
Bug 1512977 - Part 1: Remove charset aliases for unsupported x-mac-NNNNN and MUTF-7, remove hard-coded x-windows-949. r=hsivonen a=jorgk
mailnews/compose/src/nsMsgCompose.cpp
mailnews/intl/charsetData.properties
mailnews/intl/charsetalias.properties
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -1599,21 +1599,16 @@ NS_IMETHODIMP nsMsgCompose::GetEditor(ns
 NS_IMETHODIMP nsMsgCompose::SetEditor(nsIEditor *aEditor)
 {
   m_editor = aEditor;
   return NS_OK;
 }
 
 static nsresult fixCharset(nsCString &aCharset)
 {
-  // No matter what, we should block x-windows-949 (our internal name)
-  // from being used for outgoing emails (bug 234958).
-  if (aCharset.Equals("x-windows-949", nsCaseInsensitiveCStringComparator()))
-    aCharset = "EUC-KR";
-
   // Convert to a canonical charset name.
   nsresult rv;
   nsCOMPtr<nsICharsetConverterManager> ccm =
     do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString charset(aCharset);
   rv = ccm->GetCharsetAlias(charset.get(), aCharset);
--- a/mailnews/intl/charsetData.properties
+++ b/mailnews/intl/charsetData.properties
@@ -11,20 +11,16 @@
 ## charset_name.isInternal = anything - specifies that this charset should
 ## not be exposed to web content because of the vulnerability to XSS attacks
 ## or some other reasons
 ##
 ## charset_name.LangGroup = 
 ##
 ## charset_name.isMultibyte = multi byte charsets
 
-x-mac-arabic.isInternal                 = true
-x-mac-farsi.isInternal                  = true
-x-mac-hebrew.isInternal                 = true
-x-imap4-modified-utf7.isInternal        = true
 replacement.isInternal                  = true
 
 # XXX : todo: move to something based on BCP 47 (RFC 5646);
 # these should primarily specify script (and sometimes region),
 # but NOT language.
 # See also https://bugzilla.mozilla.org/show_bug.cgi?id=756022
 # e.g. x-western      -> *-Latn-155 (Western Europe),
 #                        *-Latn-151 (Eastern Europe),
@@ -36,17 +32,16 @@ replacement.isInternal                  
 #      zh-CN          -> *-Hans
 #      ja             -> *-Jpan
 #      ko             -> *-Hang
 #      he             -> *-Hebr
 #      ar             -> *-Arab
 # etc
 
 big5.LangGroup                     = zh-TW
-x-x-big5.LangGroup                 = zh-TW
 big5-hkscs.LangGroup               = zh-HK
 euc-jp.LangGroup                   = ja
 euc-kr.LangGroup                   = ko
 gb2312.LangGroup                   = zh-CN
 gb18030.LangGroup                  = zh-CN
 gb18030.2000-0.LangGroup           = zh-CN
 gb18030.2000-1.LangGroup           = zh-CN
 hkscs-1.LangGroup                  = zh-HK
@@ -73,45 +68,34 @@ koi8-r.LangGroup                   = x-c
 koi8-u.LangGroup                   = x-cyrillic
 shift_jis.LangGroup                = ja
 windows-874.LangGroup              = th
 utf-8.LangGroup                    = x-unicode
 utf-16.LangGroup                   = x-unicode
 utf-16be.LangGroup                 = x-unicode
 utf-16le.LangGroup                 = x-unicode
 utf-7.LangGroup                    = x-unicode
-x-imap4-modified-utf7.LangGroup    = x-unicode
 replacement.LangGroup              = x-unicode
 windows-1250.LangGroup             = x-western
 windows-1251.LangGroup             = x-cyrillic
 windows-1252.LangGroup             = x-western
 windows-1253.LangGroup             = el
 windows-1254.LangGroup             = x-western
 windows-1255.LangGroup             = he
 windows-1256.LangGroup             = ar
 windows-1257.LangGroup             = x-western
 windows-1258.LangGroup             = x-western
 gbk.LangGroup                      = zh-CN
-x-mac-ce.LangGroup                 = x-western
-x-mac-croatian.LangGroup           = x-western
+
+# The following two are in the Encoding Standard (https://encoding.spec.whatwg.org/),
+# x-mac-ukrainian is a label.
 x-mac-cyrillic.LangGroup           = x-cyrillic
-x-mac-devanagari.LangGroup         = x-devanagari
-x-mac-farsi.LangGroup              = ar
-x-mac-greek.LangGroup              = el
-x-mac-gujarati.LangGroup           = x-gujr
-x-mac-gurmukhi.LangGroup           = x-guru
-x-mac-icelandic.LangGroup          = x-western
 macintosh.LangGroup                = x-western
-x-mac-turkish.LangGroup            = x-western
-x-mac-ukrainian.LangGroup          = x-cyrillic
-x-mac-romanian.LangGroup           = x-western
+
 x-user-defined.LangGroup           = x-unicode
-ks_c_5601-1987.LangGroup           = ko
-x-mac-hebrew.LangGroup             = he
-x-mac-arabic.LangGroup             = ar
 
 iso-2022-jp.isMultibyte     = true
 shift_jis.isMultibyte       = true
 euc-jp.isMultibyte          = true
 big5.isMultibyte            = true
 big5-hkscs.isMultibyte      = true
 gb2312.isMultibyte          = true
 euc-kr.isMultibyte          = true
--- a/mailnews/intl/charsetalias.properties
+++ b/mailnews/intl/charsetalias.properties
@@ -10,35 +10,16 @@
 #
 # This file contains email-specific labels. Web-relevant labels for
 # encodings are in the Encoding Standard / encoding_rs.
 
 # Added for Solaris ns_langinfo. Unlikely relevant to email.
 # https://bugzilla.mozilla.org/show_bug.cgi?id=77300#c9
 646=windows-1252
 
-# Netscape private ...
-# This should probably no longer be in this file.
-x-imap4-modified-utf7=x-imap4-modified-utf7
-
-# Unsupported for outgoing mail but still used for testing in
-# composition/test-charset-edit.js and referenced in charsetData.properties.
-x-mac-ce=x-mac-ce
-x-mac-turkish=x-mac-turkish
-x-mac-greek=x-mac-greek
-x-mac-icelandic=x-mac-icelandic
-x-mac-croatian=x-mac-croatian
-x-mac-romanian=x-mac-romanian
-x-mac-hebrew=x-mac-hebrew
-x-mac-arabic=x-mac-arabic
-x-mac-farsi=x-mac-farsi
-x-mac-devanagari=x-mac-devanagari
-x-mac-gujarati=x-mac-gujarati
-x-mac-gurmukhi=x-mac-gurmukhi
-
 # Aliases for ISO-8859-8-I
 # From the original IBM bidi patch.
 iso-8859-8i=ISO-8859-8-I
 
 # ISO 8859 series with underscore for JavaMail
 # compat.
 # https://bugzilla.mozilla.org/show_bug.cgi?id=820767
 iso8859_1=windows-1252
@@ -106,16 +87,18 @@ iso2022jp=ISO-2022-JP
 # dtmail on Sun Solaris
 # https://bugzilla.mozilla.org/show_bug.cgi?id=146287
 zh_tw-big5=Big5
 
 # Aliases for EUC-KR
 # Added for Solaris ns_langinfo. Unlikely relevant to email.
 # https://bugzilla.mozilla.org/show_bug.cgi?id=82075
 5601=EUC-KR
+# https://bugzilla.mozilla.org/show_bug.cgi?id=234958
+x-windows-949=EUC-KR
 
 # Aliases for windows-874
 # Added originally for nl_langinfo reasons but could plausibly be sent
 # by JavaMail.
 # https://bugzilla.mozilla.org/show_bug.cgi?id=101295
 tis620=windows-874
 
 # Aliases for IBM866