Bug 802069 - Make "macintosh" the canonical name of its encoding, not "x-mac-roman"; r=smontagu
authorAryeh Gregor <ayg@aryeh.name>
Wed, 17 Oct 2012 12:15:23 +0200
changeset 110656 07ccbbd6fbb040d66759f853a40fdd0794872882
parent 110655 506a35df1d672d0110111ceb29bfd83ccc8aab34
child 110657 d8cf2a31d1b92dcf202a7f8cd9f44c89e7946498
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewerssmontagu
bugs802069
milestone19.0a1
Bug 802069 - Make "macintosh" the canonical name of its encoding, not "x-mac-roman"; r=smontagu
dom/locales/en-US/chrome/charsetTitles.properties
dom/plugins/base/nsPluginInstanceOwner.cpp
gfx/thebes/gfxFontUtils.cpp
intl/locale/src/charsetalias.properties
intl/uconv/src/charsetData.properties
intl/uconv/src/nsMacRomanToUnicode.h
intl/uconv/src/nsUConvModule.cpp
intl/uconv/src/nsUnicodeToMacRoman.h
intl/uconv/tests/unit/test_bug718500.js
intl/uconv/tests/unit/test_decode_macintosh.js
intl/uconv/tests/unit/test_decode_x_mac_roman.js
intl/uconv/tests/unit/test_encode_macintosh.js
intl/uconv/tests/unit/test_encode_x_mac_roman.js
intl/uconv/tests/unit/xpcshell.ini
modules/libpref/src/init/all.js
toolkit/components/search/nsSearchService.js
--- a/dom/locales/en-US/chrome/charsetTitles.properties
+++ b/dom/locales/en-US/chrome/charsetTitles.properties
@@ -20,17 +20,17 @@ iso-8859-10.title   = Nordic (ISO-8859-1
 iso-8859-13.title   = Baltic (ISO-8859-13)
 iso-8859-14.title   = Celtic (ISO-8859-14)
 iso-8859-15.title   = Western (ISO-8859-15)
 iso-8859-16.title   = Romanian (ISO-8859-16)
 windows-1250.title  = Central European (Windows-1250)
 windows-1252.title  = Western (Windows-1252)
 windows-1254.title  = Turkish (Windows-1254)
 windows-1257.title  = Baltic (Windows-1257)
-x-mac-roman.title       = Western (MacRoman)
+macintosh.title       = Western (MacRoman)
 x-mac-ce.title          = Central European (MacCE)
 x-mac-turkish.title     = Turkish (MacTurkish)
 x-mac-croatian.title    = Croatian (MacCroatian)
 x-mac-romanian.title    = Romanian (MacRomanian)
 x-mac-icelandic.title   = Icelandic (MacIcelandic)
 iso-2022-jp.title = Japanese (ISO-2022-JP)
 shift_jis.title = Japanese (Shift_JIS)
 euc-jp.title = Japanese (EUC-JP)
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -979,17 +979,17 @@ static const moz2javaCharset charsets[] 
     {"TIS-620",         "MS874"},
     {"x-windows-949",   "MS949"},
     {"x-mac-arabic",    "MacArabic"},
     {"x-mac-croatian",  "MacCroatia"},
     {"x-mac-cyrillic",  "MacCyrillic"},
     {"x-mac-greek",     "MacGreek"},
     {"x-mac-hebrew",    "MacHebrew"},
     {"x-mac-icelandic", "MacIceland"},
-    {"x-mac-roman",     "MacRoman"},
+    {"macintosh",       "MacRoman"},
     {"x-mac-romanian",  "MacRomania"},
     {"x-mac-ukrainian", "MacUkraine"},
     {"Shift_JIS",       "SJIS"},
     {"TIS-620",         "TIS620"}
 };
 
 NS_IMETHODIMP nsPluginInstanceOwner::GetDocumentEncoding(const char* *result)
 {
--- a/gfx/thebes/gfxFontUtils.cpp
+++ b/gfx/thebes/gfxFontUtils.cpp
@@ -1609,24 +1609,24 @@ gfxFontUtils::ReadCanonicalName(Fallible
 
 // Some "redundant" entries for specific combinations are included such as
 // encoding=roman, lang=english, in order that common entries will be found
 // on the first search.
 
 #define ANY 0xffff
 const gfxFontUtils::MacFontNameCharsetMapping gfxFontUtils::gMacFontNameCharsets[] =
 {
-    { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_ENGLISH,      "x-mac-roman"     },
+    { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_ENGLISH,      "macintosh"       },
     { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_ICELANDIC,    "x-mac-icelandic" },
     { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_TURKISH,      "x-mac-turkish"   },
     { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_POLISH,       "x-mac-ce"        },
     { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_ROMANIAN,     "x-mac-romanian"  },
     { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_CZECH,        "x-mac-ce"        },
     { ENCODING_ID_MAC_ROMAN,        LANG_ID_MAC_SLOVAK,       "x-mac-ce"        },
-    { ENCODING_ID_MAC_ROMAN,        ANY,                      "x-mac-roman"     },
+    { ENCODING_ID_MAC_ROMAN,        ANY,                      "macintosh"       },
     { ENCODING_ID_MAC_JAPANESE,     LANG_ID_MAC_JAPANESE,     "Shift_JIS"       },
     { ENCODING_ID_MAC_JAPANESE,     ANY,                      "Shift_JIS"       },
     { ENCODING_ID_MAC_TRAD_CHINESE, LANG_ID_MAC_TRAD_CHINESE, "Big5"            },
     { ENCODING_ID_MAC_TRAD_CHINESE, ANY,                      "Big5"            },
     { ENCODING_ID_MAC_KOREAN,       LANG_ID_MAC_KOREAN,       "EUC-KR"          },
     { ENCODING_ID_MAC_KOREAN,       ANY,                      "EUC-KR"          },
     { ENCODING_ID_MAC_ARABIC,       LANG_ID_MAC_ARABIC,       "x-mac-arabic"    },
     { ENCODING_ID_MAC_ARABIC,       LANG_ID_MAC_URDU,         "x-mac-farsi"     },
--- a/intl/locale/src/charsetalias.properties
+++ b/intl/locale/src/charsetalias.properties
@@ -90,17 +90,16 @@ hz-gb-2312=HZ-GB-2312
 big5-hkscs=Big5-HKSCS
 gbk=gbk
 cns11643=x-euc-tw
 #
 # Netscape private ...
 #
 x-imap4-modified-utf7=x-imap4-modified-utf7
 x-euc-tw=x-euc-tw
-x-mac-roman=x-mac-roman
 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-cyrillic=x-mac-cyrillic
 x-mac-ukrainian=x-mac-cyrillic
@@ -318,22 +317,22 @@ x-cp1257=windows-1257
 x-cp1258=windows-1258
 #
 # Aliases for windows-874 
 #
 windows-874=windows-874
 ibm874=windows-874
 dos-874=windows-874
 #
-# Aliases for x-mac-roman
-# XXX: should make macintosh the canonical name later
+# Aliases for macintosh
 #
-macintosh=x-mac-roman
-mac=x-mac-roman
-csmacintosh=x-mac-roman
+macintosh=macintosh
+x-mac-roman=macintosh
+mac=macintosh
+csmacintosh=macintosh
 #
 # Aliases for IBM866
 #
 cp866=IBM866
 cp-866=IBM866
 866=IBM866
 csibm866=IBM866
 #
--- a/intl/uconv/src/charsetData.properties
+++ b/intl/uconv/src/charsetData.properties
@@ -173,17 +173,17 @@ x-mac-ce.LangGroup                 = x-c
 x-mac-croatian.LangGroup           = x-central-euro
 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
-x-mac-roman.LangGroup              = x-western
+macintosh.LangGroup                = x-western
 x-mac-turkish.LangGroup            = tr
 x-mac-ukrainian.LangGroup          = x-cyrillic
 x-mac-romanian.LangGroup           = x-central-euro
 x-user-defined.LangGroup           = x-user-def
 ks_c_5601-1987.LangGroup           = ko
 x-johab.LangGroup                  = ko
 x-windows-949.LangGroup            = ko
 x-mac-hebrew.LangGroup             = he
--- a/intl/uconv/src/nsMacRomanToUnicode.h
+++ b/intl/uconv/src/nsMacRomanToUnicode.h
@@ -8,17 +8,17 @@
 
 #include "nsISupports.h"
 
 // Class ID for our MacRomanToUnicode charset converter
 // {7B8556A1-EC79-11d2-8AAC-00600811A836}
 #define NS_MACROMANTOUNICODE_CID \
   { 0x7b8556a1, 0xec79, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
-#define NS_MACROMANTOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=x-mac-roman"
+#define NS_MACROMANTOUNICODE_CONTRACTID "@mozilla.org/intl/unicode/decoder;1?charset=macintosh"
 
 //#define NS_ERROR_UCONV_NOMACROMANTOUNICODE   
 //  NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_UCONV, 0x31)
 
 /**
  * A character set converter from MacRoman to Unicode.
  *
  * @created         05/Apr/1999
--- a/intl/uconv/src/nsUConvModule.cpp
+++ b/intl/uconv/src/nsUConvModule.cpp
@@ -229,17 +229,17 @@
 #include "nsUnicodeToGB2312V2.h"
 #include "nsISO2022CNToUnicode.h"
 #include "nsUnicodeToISO2022CN.h"
 #include "gbku.h"
 
 NS_CONVERTER_REGISTRY_START
 NS_UCONV_REG_UNREG("ISO-8859-1", NS_ISO88591TOUNICODE_CID, NS_UNICODETOISO88591_CID)
 NS_UCONV_REG_UNREG("windows-1252", NS_CP1252TOUNICODE_CID, NS_UNICODETOCP1252_CID)
-NS_UCONV_REG_UNREG("x-mac-roman", NS_MACROMANTOUNICODE_CID, NS_UNICODETOMACROMAN_CID)
+NS_UCONV_REG_UNREG("macintosh", NS_MACROMANTOUNICODE_CID, NS_UNICODETOMACROMAN_CID)
 NS_UCONV_REG_UNREG("UTF-8", NS_UTF8TOUNICODE_CID, NS_UNICODETOUTF8_CID)
 
   // ucvlatin
 NS_UCONV_REG_UNREG("us-ascii", NS_ASCIITOUNICODE_CID, NS_UNICODETOASCII_CID)
 NS_UCONV_REG_UNREG("ISO-8859-2", NS_ISO88592TOUNICODE_CID, NS_UNICODETOISO88592_CID)
 NS_UCONV_REG_UNREG("ISO-8859-3", NS_ISO88593TOUNICODE_CID, NS_UNICODETOISO88593_CID)
 NS_UCONV_REG_UNREG("ISO-8859-4", NS_ISO88594TOUNICODE_CID, NS_UNICODETOISO88594_CID)
 NS_UCONV_REG_UNREG("ISO-8859-5", NS_ISO88595TOUNICODE_CID, NS_UNICODETOISO88595_CID)
--- a/intl/uconv/src/nsUnicodeToMacRoman.h
+++ b/intl/uconv/src/nsUnicodeToMacRoman.h
@@ -8,17 +8,17 @@
 
 #include "nsISupports.h"
 
 // Class ID for our UnicodeToMacRoman charset converter
 // {7B8556AF-EC79-11d2-8AAC-00600811A836}
 #define NS_UNICODETOMACROMAN_CID \
   { 0x7b8556af, 0xec79, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
 
-#define NS_UNICODETOMACROMAN_CONTRACTID "@mozilla.org/intl/unicode/encoder;1?charset=x-mac-roman"
+#define NS_UNICODETOMACROMAN_CONTRACTID "@mozilla.org/intl/unicode/encoder;1?charset=macintosh"
 
 /**
  * A character set converter from Unicode to MacRoman.
  *
  * @created         05/Apr/1999
  * @author  Catalin Rotaru [CATA]
  */
 nsresult
--- a/intl/uconv/tests/unit/test_bug718500.js
+++ b/intl/uconv/tests/unit/test_bug718500.js
@@ -9,17 +9,17 @@ var detectList = [
   "chardet.off",
   "chardet.ruprob",
   "chardet.ukprob",
 ];
 
 var encoderList = [
   "ISO-8859-1",
   "windows-1252",
-  "x-mac-roman",
+  "macintosh",
   "UTF-8",
   "us-ascii",
   "ISO-8859-2",
   "ISO-8859-3",
   "ISO-8859-4",
   "ISO-8859-5",
   "ISO-8859-6",
   "ISO-8859-6-I",
@@ -100,17 +100,17 @@ var encoderList = [
   "gbk",
   "HZ-GB-2312",
   "gb18030",
 ];
 
 var decoderList = [
   "ISO-8859-1",
   "windows-1252",
-  "x-mac-roman",
+  "macintosh",
   "UTF-8",
   "us-ascii",
   "ISO-8859-2",
   "ISO-8859-3",
   "ISO-8859-4",
   "ISO-8859-5",
   "ISO-8859-6",
   "ISO-8859-6-I",
rename from intl/uconv/tests/unit/test_decode_x_mac_roman.js
rename to intl/uconv/tests/unit/test_decode_macintosh.js
rename from intl/uconv/tests/unit/test_encode_x_mac_roman.js
rename to intl/uconv/tests/unit/test_encode_macintosh.js
--- a/intl/uconv/tests/unit/xpcshell.ini
+++ b/intl/uconv/tests/unit/xpcshell.ini
@@ -82,17 +82,17 @@ tail =
 [test_decode_x_mac_farsi.js]
 [test_decode_x_mac_farsi_internal.js]
 [test_decode_x_mac_greek.js]
 [test_decode_x_mac_gujarati.js]
 [test_decode_x_mac_gurmukhi.js]
 [test_decode_x_mac_hebrew.js]
 [test_decode_x_mac_hebrew_internal.js]
 [test_decode_x_mac_icelandic.js]
-[test_decode_x_mac_roman.js]
+[test_decode_macintosh.js]
 [test_decode_x_mac_romanian.js]
 [test_decode_x_mac_turkish.js]
 [test_decode_x_mac_ukrainian.js]
 [test_encode_8859-1.js]
 [test_encode_8859-10.js]
 [test_encode_8859-11.js]
 [test_encode_8859-13.js]
 [test_encode_8859-14.js]
@@ -137,14 +137,14 @@ tail =
 [test_encode_x_mac_farsi.js]
 [test_encode_x_mac_farsi_internal.js]
 [test_encode_x_mac_greek.js]
 [test_encode_x_mac_gujarati.js]
 [test_encode_x_mac_gurmukhi.js]
 [test_encode_x_mac_hebrew.js]
 [test_encode_x_mac_hebrew_internal.js]
 [test_encode_x_mac_icelandic.js]
-[test_encode_x_mac_roman.js]
+[test_encode_macintosh.js]
 [test_encode_x_mac_romanian.js]
 [test_encode_x_mac_turkish.js]
 [test_encode_x_mac_ukrainian.js]
 [test_iso2022KR.js]
 [test_utf8_illegals.js]
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1254,17 +1254,17 @@ pref("network.stricttransportsecurity.pr
 
 pref("converter.html2txt.structs",          true); // Output structured phrases (strong, em, code, sub, sup, b, i, u)
 pref("converter.html2txt.header_strategy",  1); // 0 = no indention; 1 = indention, increased with header level; 2 = numbering and slight indention
 
 pref("intl.accept_languages",               "chrome://global/locale/intl.properties");
 pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties");
 pref("intl.menuitems.insertseparatorbeforeaccesskeys","chrome://global/locale/intl.properties");
 pref("intl.charsetmenu.browser.static",     "chrome://global/locale/intl.properties");
-pref("intl.charsetmenu.browser.more1",      "ISO-8859-1, ISO-8859-15, IBM850, x-mac-roman, windows-1252, ISO-8859-14, ISO-8859-7, x-mac-greek, windows-1253, x-mac-icelandic, ISO-8859-10, ISO-8859-3");
+pref("intl.charsetmenu.browser.more1",      "ISO-8859-1, ISO-8859-15, IBM850, macintosh, windows-1252, ISO-8859-14, ISO-8859-7, x-mac-greek, windows-1253, x-mac-icelandic, ISO-8859-10, ISO-8859-3");
 pref("intl.charsetmenu.browser.more2",      "ISO-8859-4, ISO-8859-13, windows-1257, IBM852, ISO-8859-2, x-mac-ce, windows-1250, x-mac-croatian, IBM855, ISO-8859-5, ISO-IR-111, KOI8-R, x-mac-cyrillic, windows-1251, IBM866, KOI8-U, x-mac-ukrainian, ISO-8859-16, x-mac-romanian");
 pref("intl.charsetmenu.browser.more3",      "GB2312, gbk, gb18030, HZ-GB-2312, ISO-2022-CN, Big5, Big5-HKSCS, x-euc-tw, EUC-JP, ISO-2022-JP, Shift_JIS, EUC-KR, x-windows-949, x-johab, ISO-2022-KR");
 pref("intl.charsetmenu.browser.more4",      "armscii-8, TIS-620, ISO-8859-11, windows-874, IBM857, ISO-8859-9, x-mac-turkish, windows-1254, x-viet-tcvn5712, VISCII, x-viet-vps, windows-1258, x-mac-devanagari, x-mac-gujarati, x-mac-gurmukhi");
 pref("intl.charsetmenu.browser.more5",      "ISO-8859-6, windows-1256, ISO-8859-8-I, windows-1255, ISO-8859-8, IBM862");
 pref("intl.charsetmenu.browser.unicode",    "UTF-8, UTF-16LE, UTF-16BE");
 pref("intl.charsetmenu.mailedit",           "chrome://global/locale/intl.properties");
 pref("intl.charsetmenu.browser.cache",      "");
 pref("intl.charsetmenu.mailview.cache",     "");
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -442,17 +442,17 @@ function getDir(aKey, aIFace) {
 }
 
 /**
  * The following two functions are essentially copied from
  * nsInternetSearchService. They are required for backwards compatibility.
  */
 function queryCharsetFromCode(aCode) {
   const codes = [];
-  codes[0] = "x-mac-roman";
+  codes[0] = "macintosh";
   codes[6] = "x-mac-greek";
   codes[35] = "x-mac-turkish";
   codes[513] = "ISO-8859-1";
   codes[514] = "ISO-8859-2";
   codes[517] = "ISO-8859-5";
   codes[518] = "ISO-8859-6";
   codes[519] = "ISO-8859-7";
   codes[520] = "ISO-8859-8";
@@ -482,17 +482,17 @@ function queryCharsetFromCode(aCode) {
 
   if (codes[aCode])
     return codes[aCode];
 
   return getLocalizedPref("intl.charset.default", DEFAULT_QUERY_CHARSET);
 }
 function fileCharsetFromCode(aCode) {
   const codes = [
-    "x-mac-roman",           // 0
+    "macintosh",             // 0
     "Shift_JIS",             // 1
     "Big5",                  // 2
     "EUC-KR",                // 3
     "X-MAC-ARABIC",          // 4
     "X-MAC-HEBREW",          // 5
     "X-MAC-GREEK",           // 6
     "X-MAC-CYRILLIC",        // 7
     "X-MAC-DEVANAGARI" ,     // 9
@@ -514,17 +514,17 @@ function fileCharsetFromCode(aCode) {
     "GB2312",                // 25
     "X-MAC-TIBETAN",         // 26
     "X-MAC-MONGOLIAN",       // 27
     "X-MAC-ETHIOPIC",        // 28
     "X-MAC-CENTRALEURROMAN", // 29
     "X-MAC-VIETNAMESE",      // 30
     "X-MAC-EXTARABIC"        // 31
   ];
-  // Sherlock files have always defaulted to x-mac-roman, so do that here too
+  // Sherlock files have always defaulted to macintosh, so do that here too
   return codes[aCode] || codes[0];
 }
 
 /**
  * Returns a string interpretation of aBytes using aCharset, or null on
  * failure.
  */
 function bytesToString(aBytes, aCharset) {