From 80c69719d335a98497a32e7344b0a86089ccd57f Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Mon, 22 Sep 2014 16:15:34 +0300 Subject: [PATCH] Bug 1069954 - Remove us-ascii as a Gecko-canonical encoding name. r=emk. --- gfx/thebes/gfxFontUtils.cpp | 4 ++-- intl/uconv/moz.build | 2 -- intl/uconv/nsUConvModule.cpp | 9 ------- intl/uconv/ucvlatin/nsAsciiToUnicode.cpp | 25 -------------------- intl/uconv/ucvlatin/nsAsciiToUnicode.h | 21 ---------------- intl/uconv/ucvlatin/nsUnicodeToAscii.cpp | 24 ------------------- intl/uconv/ucvlatin/nsUnicodeToAscii.h | 21 ---------------- toolkit/components/search/nsSearchService.js | 1 - 8 files changed, 2 insertions(+), 105 deletions(-) delete mode 100644 intl/uconv/ucvlatin/nsAsciiToUnicode.cpp delete mode 100644 intl/uconv/ucvlatin/nsAsciiToUnicode.h delete mode 100644 intl/uconv/ucvlatin/nsUnicodeToAscii.cpp delete mode 100644 intl/uconv/ucvlatin/nsUnicodeToAscii.h diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index 8a0f678ce83..482846e00d6 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -1314,9 +1314,9 @@ const gfxFontUtils::MacFontNameCharsetMapping gfxFontUtils::gMacFontNameCharsets const char* gfxFontUtils::gISOFontNameCharsets[] = { - /* 0 */ "us-ascii" , + /* 0 */ "windows-1252", /* US-ASCII */ /* 1 */ nullptr , /* spec says "ISO 10646" but does not specify encoding form! */ - /* 2 */ "ISO-8859-1" + /* 2 */ "windows-1252" /* ISO-8859-1 */ }; const char* gfxFontUtils::gMSFontNameCharsets[] = diff --git a/intl/uconv/moz.build b/intl/uconv/moz.build index 7c691388cac..ada794984b9 100644 --- a/intl/uconv/moz.build +++ b/intl/uconv/moz.build @@ -70,7 +70,6 @@ UNIFIED_SOURCES += [ ] UNIFIED_SOURCES += [ - 'ucvlatin/nsAsciiToUnicode.cpp', 'ucvlatin/nsCP1250ToUnicode.cpp', 'ucvlatin/nsCP1251ToUnicode.cpp', 'ucvlatin/nsCP1253ToUnicode.cpp', @@ -112,7 +111,6 @@ UNIFIED_SOURCES += [ 'ucvlatin/nsMacRomanianToUnicode.cpp', 'ucvlatin/nsMacTurkishToUnicode.cpp', 'ucvlatin/nsTIS620ToUnicode.cpp', - 'ucvlatin/nsUnicodeToAscii.cpp', 'ucvlatin/nsUnicodeToCP1250.cpp', 'ucvlatin/nsUnicodeToCP1251.cpp', 'ucvlatin/nsUnicodeToCP1253.cpp', diff --git a/intl/uconv/nsUConvModule.cpp b/intl/uconv/nsUConvModule.cpp index d58734622a6..1bbbec82d9b 100644 --- a/intl/uconv/nsUConvModule.cpp +++ b/intl/uconv/nsUConvModule.cpp @@ -28,7 +28,6 @@ // ucvlatin #include "nsUCvLatinCID.h" -#include "nsAsciiToUnicode.h" #include "nsISO88592ToUnicode.h" #include "nsISO88593ToUnicode.h" #include "nsISO88594ToUnicode.h" @@ -66,7 +65,6 @@ #include "nsMacIcelandicToUnicode.h" #include "nsUTF16ToUnicode.h" #include "nsUserDefinedToUnicode.h" -#include "nsUnicodeToAscii.h" #include "nsUnicodeToISO88592.h" #include "nsUnicodeToISO88593.h" #include "nsUnicodeToISO88594.h" @@ -146,7 +144,6 @@ NS_UCONV_REG_UNREG("UTF-8", NS_UTF8TOUNICODE_CID, NS_UNICODETOUTF8_CID) NS_UCONV_REG_UNREG("replacement", NS_REPLACEMENTTOUNICODE_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) @@ -318,7 +315,6 @@ NS_DEFINE_NAMED_CID(NS_UNICODETOISO88591_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOCP1252_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOMACROMAN_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOUTF8_CID); -NS_DEFINE_NAMED_CID(NS_ASCIITOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_ISO88592TOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_ISO88593TOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_ISO88594TOUNICODE_CID); @@ -364,7 +360,6 @@ NS_DEFINE_NAMED_CID(NS_MACFARSITOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_MACGURMUKHITOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_MACGUJARATITOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_MACHEBREWTOUNICODE_CID); -NS_DEFINE_NAMED_CID(NS_UNICODETOASCII_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOISO88592_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOISO88593_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOISO88594_CID); @@ -434,7 +429,6 @@ static const mozilla::Module::CIDEntry kUConvCIDs[] = { { &kNS_UNICODETOCP1252_CID, false, nullptr, nsUnicodeToCP1252Constructor }, { &kNS_UNICODETOMACROMAN_CID, false, nullptr, nsUnicodeToMacRomanConstructor }, { &kNS_UNICODETOUTF8_CID, false, nullptr, nsUnicodeToUTF8Constructor }, - { &kNS_ASCIITOUNICODE_CID, false, nullptr, nsAsciiToUnicodeConstructor }, { &kNS_ISO88592TOUNICODE_CID, false, nullptr, nsISO88592ToUnicodeConstructor }, { &kNS_ISO88593TOUNICODE_CID, false, nullptr, nsISO88593ToUnicodeConstructor }, { &kNS_ISO88594TOUNICODE_CID, false, nullptr, nsISO88594ToUnicodeConstructor }, @@ -480,7 +474,6 @@ static const mozilla::Module::CIDEntry kUConvCIDs[] = { { &kNS_MACGURMUKHITOUNICODE_CID, false, nullptr, nsMacGurmukhiToUnicodeConstructor }, { &kNS_MACGUJARATITOUNICODE_CID, false, nullptr, nsMacGujaratiToUnicodeConstructor }, { &kNS_MACHEBREWTOUNICODE_CID, false, nullptr, nsMacHebrewToUnicodeConstructor }, - { &kNS_UNICODETOASCII_CID, false, nullptr, nsUnicodeToAsciiConstructor }, { &kNS_UNICODETOISO88592_CID, false, nullptr, nsUnicodeToISO88592Constructor }, { &kNS_UNICODETOISO88593_CID, false, nullptr, nsUnicodeToISO88593Constructor }, { &kNS_UNICODETOISO88594_CID, false, nullptr, nsUnicodeToISO88594Constructor }, @@ -552,7 +545,6 @@ static const mozilla::Module::ContractIDEntry kUConvContracts[] = { { NS_UNICODETOCP1252_CONTRACTID, &kNS_UNICODETOCP1252_CID }, { NS_UNICODETOMACROMAN_CONTRACTID, &kNS_UNICODETOMACROMAN_CID }, { NS_UNICODETOUTF8_CONTRACTID, &kNS_UNICODETOUTF8_CID }, - { NS_UNICODEDECODER_CONTRACTID_BASE "us-ascii", &kNS_ASCIITOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-2", &kNS_ISO88592TOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-3", &kNS_ISO88593TOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-8859-4", &kNS_ISO88594TOUNICODE_CID }, @@ -598,7 +590,6 @@ static const mozilla::Module::ContractIDEntry kUConvContracts[] = { { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-gurmukhi", &kNS_MACGURMUKHITOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-gujarati", &kNS_MACGUJARATITOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "x-mac-hebrew", &kNS_MACHEBREWTOUNICODE_CID }, - { NS_UNICODEENCODER_CONTRACTID_BASE "us-ascii", &kNS_UNICODETOASCII_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-2", &kNS_UNICODETOISO88592_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-3", &kNS_UNICODETOISO88593_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "ISO-8859-4", &kNS_UNICODETOISO88594_CID }, diff --git a/intl/uconv/ucvlatin/nsAsciiToUnicode.cpp b/intl/uconv/ucvlatin/nsAsciiToUnicode.cpp deleted file mode 100644 index bc8f3f8a451..00000000000 --- a/intl/uconv/ucvlatin/nsAsciiToUnicode.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsUCConstructors.h" -#include "nsAsciiToUnicode.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -// use iso-8859-1 decoder to interpret us-ascii. Some websites are mistakenly -// labeled as us-ascii for iso-8859-1. Be generous here should be fine. - -nsresult -nsAsciiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult) -{ - static const uint16_t g_utMappingTable[] = { -#include "cp1252.ut" - }; - - return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, - aOuter, aIID, aResult); -} diff --git a/intl/uconv/ucvlatin/nsAsciiToUnicode.h b/intl/uconv/ucvlatin/nsAsciiToUnicode.h deleted file mode 100644 index 6d35eac02f9..00000000000 --- a/intl/uconv/ucvlatin/nsAsciiToUnicode.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsAsciiToUnicode_h___ -#define nsAsciiToUnicode_h___ - -#include "nsISupports.h" - -/** - * A character set converter from Ascii to Unicode. - * - * @created 23/Nov/1998 - * @author Catalin Rotaru [CATA] - */ -nsresult -nsAsciiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - -#endif /* nsAsciiToUnicode_h___ */ diff --git a/intl/uconv/ucvlatin/nsUnicodeToAscii.cpp b/intl/uconv/ucvlatin/nsUnicodeToAscii.cpp deleted file mode 100644 index 0c6f430c5af..00000000000 --- a/intl/uconv/ucvlatin/nsUnicodeToAscii.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsUCConstructors.h" -#include "nsUnicodeToAscii.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -nsresult -nsUnicodeToAsciiConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult) -{ - static const uint16_t g_ufMappingTable[] = { - 0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000 - }; - - return CreateTableEncoder(u1ByteCharset, - (uMappingTable*) &g_ufMappingTable, 1, - aOuter, aIID, aResult); -} - diff --git a/intl/uconv/ucvlatin/nsUnicodeToAscii.h b/intl/uconv/ucvlatin/nsUnicodeToAscii.h deleted file mode 100644 index 5637b6299d3..00000000000 --- a/intl/uconv/ucvlatin/nsUnicodeToAscii.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsUnicodeToAscii_h___ -#define nsUnicodeToAscii_h___ - -#include "nsISupports.h" - -/** - * A character set converter from Unicode to Ascii. - * - * @created 17/Feb/1999 - * @author Catalin Rotaru [CATA] - */ -nsresult -nsUnicodeToAsciiConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - -#endif /* nsUnicodeToAscii_h___ */ diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index 4cffe8a6388..3a29a759926 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -488,7 +488,6 @@ function queryCharsetFromCode(aCode) { codes[1284] = "windows-1254"; codes[1285] = "windows-1255"; codes[1286] = "windows-1256"; - codes[1536] = "us-ascii"; codes[1584] = "GB2312"; codes[1585] = "gbk"; codes[1600] = "EUC-KR";