Bug 943268 - Remove nsCharsetAlias and nsCharsetConverterManager. r=emk.
authorHenri Sivonen <hsivonen@hsivonen.fi>
Thu, 08 May 2014 12:32:00 +0300
changeset 182095 15680e55195c68c876414ca8521a546dd2292915
parent 182094 135afc151b7544fdfc50cb66bcee64d3d332025e
child 182096 a520a43d065c54fd65a0fd1351e56e2b148ba9a5
push id43211
push userhsivonen@mozilla.com
push dateThu, 08 May 2014 09:32:47 +0000
treeherdermozilla-inbound@15680e55195c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs943268
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 943268 - Remove nsCharsetAlias and nsCharsetConverterManager. r=emk.
b2g/locales/jar.mn
browser/components/customizableui/src/CustomizableWidgets.jsm
content/base/src/nsDocument.cpp
content/base/src/nsDocumentEncoder.cpp
dom/archivereader/ArchiveReader.cpp
dom/encoding/EncodingUtils.cpp
dom/encoding/EncodingUtils.h
dom/encoding/Makefile.in
dom/encoding/TextDecoder.cpp
dom/encoding/encodingsgroups.properties
dom/encoding/moz.build
dom/locales/en-US/chrome/charsetTitles.properties
dom/locales/jar.mn
dom/plugins/base/nsPluginTags.cpp
extensions/spellcheck/hunspell/src/csutil.cpp
extensions/spellcheck/hunspell/src/mozHunspell.cpp
extensions/spellcheck/src/mozPersonalDictionary.cpp
intl/build/nsI18nModule.cpp
intl/locale/public/moz.build
intl/locale/public/nsCharsetAlias.h
intl/locale/public/nsILanguageAtomService.h
intl/locale/src/Makefile.in
intl/locale/src/charsetalias.properties
intl/locale/src/moz.build
intl/locale/src/nsCharsetAlias.cpp
intl/locale/src/nsCollation.cpp
intl/locale/src/nsLanguageAtomService.cpp
intl/locale/src/nsLanguageAtomService.h
intl/locale/src/unix/nsDateTimeFormatUnix.cpp
intl/locale/src/unix/nsDateTimeFormatUnix.h
intl/locale/src/unix/nsUNIXCharset.cpp
intl/locale/src/unix/unixcharset.properties
intl/locale/src/windows/wincharset.properties
intl/uconv/idl/moz.build
intl/uconv/idl/nsICharsetConverterManager.idl
intl/uconv/idl/nsIScriptableUConv.idl
intl/uconv/public/nsEncoderDecoderUtils.h
intl/uconv/src/charsetData.properties
intl/uconv/src/jar.mn
intl/uconv/src/moz.build
intl/uconv/src/nsCharsetConverterManager.cpp
intl/uconv/src/nsCharsetConverterManager.h
intl/uconv/src/nsConverterInputStream.cpp
intl/uconv/src/nsConverterOutputStream.cpp
intl/uconv/src/nsScriptableUConv.cpp
intl/uconv/src/nsScriptableUConv.h
intl/uconv/src/nsTextToSubURI.cpp
intl/uconv/src/nsTextToSubURI.h
intl/uconv/src/nsUConvModule.cpp
intl/uconv/src/nsUTF8ConverterService.cpp
intl/uconv/tests/test_long_doc.html
intl/uconv/tests/unit/test_bug365345.js
intl/uconv/tests/unit/test_bug381412.johab.js
intl/uconv/tests/unit/test_bug383018.js
intl/uconv/tests/unit/test_bug399257.js
intl/uconv/tests/unit/test_bug399284.js
intl/uconv/tests/unit/test_bug449578.js
intl/uconv/tests/unit/test_bug601429.js
intl/uconv/tests/unit/test_bug713519.js
intl/uconv/tests/unit/test_bug715319.dbcs.js
intl/uconv/tests/unit/test_decode_CP1251.js
intl/uconv/tests/unit/test_decode_CP850.js
intl/uconv/tests/unit/test_decode_CP852.js
intl/uconv/tests/unit/test_decode_CP855.js
intl/uconv/tests/unit/test_decode_CP857.js
intl/uconv/tests/unit/test_decode_CP862.js
intl/uconv/tests/unit/test_decode_CP864.js
intl/uconv/tests/unit/test_decode_CP874.js
intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js
intl/uconv/tests/unit/test_decode_armscii.js
intl/uconv/tests/unit/test_decode_tcvn5712.js
intl/uconv/tests/unit/test_decode_viscii.js
intl/uconv/tests/unit/test_decode_vps.js
intl/uconv/tests/unit/test_decode_x_mac_ce.js
intl/uconv/tests/unit/test_decode_x_mac_croatian.js
intl/uconv/tests/unit/test_decode_x_mac_cyrillic.js
intl/uconv/tests/unit/test_decode_x_mac_devanagari.js
intl/uconv/tests/unit/test_decode_x_mac_greek.js
intl/uconv/tests/unit/test_decode_x_mac_gujarati.js
intl/uconv/tests/unit/test_decode_x_mac_gurmukhi.js
intl/uconv/tests/unit/test_decode_x_mac_icelandic.js
intl/uconv/tests/unit/test_decode_x_mac_romanian.js
intl/uconv/tests/unit/test_decode_x_mac_turkish.js
intl/uconv/tests/unit/test_encode_CP1251.js
intl/uconv/tests/unit/test_encode_CP850.js
intl/uconv/tests/unit/test_encode_CP852.js
intl/uconv/tests/unit/test_encode_CP855.js
intl/uconv/tests/unit/test_encode_CP857.js
intl/uconv/tests/unit/test_encode_CP862.js
intl/uconv/tests/unit/test_encode_CP864.js
intl/uconv/tests/unit/test_encode_CP874.js
intl/uconv/tests/unit/test_encode_armscii.js
intl/uconv/tests/unit/test_encode_tcvn5712.js
intl/uconv/tests/unit/test_encode_viscii.js
intl/uconv/tests/unit/test_encode_vps.js
intl/uconv/tests/unit/test_encode_x_mac_ce.js
intl/uconv/tests/unit/test_encode_x_mac_croatian.js
intl/uconv/tests/unit/test_encode_x_mac_devanagari.js
intl/uconv/tests/unit/test_encode_x_mac_greek.js
intl/uconv/tests/unit/test_encode_x_mac_gujarati.js
intl/uconv/tests/unit/test_encode_x_mac_gurmukhi.js
intl/uconv/tests/unit/test_encode_x_mac_icelandic.js
intl/uconv/tests/unit/test_encode_x_mac_romanian.js
intl/uconv/tests/unit/test_encode_x_mac_turkish.js
intl/uconv/tests/unit/test_iso2022KR.js
intl/uconv/tests/unit/xpcshell.ini
intl/uconv/ucvcn/nsISO2022CNToUnicode.cpp
intl/uconv/ucvja/nsJapaneseToUnicode.cpp
intl/uconv/ucvja/nsJapaneseToUnicode.h
intl/uconv/ucvko/nsISO2022KRToUnicode.cpp
intl/uconv/ucvko/nsISO2022KRToUnicode.h
intl/unicharutil/src/nsSaveAsCharset.cpp
intl/unicharutil/src/nsSaveAsCharset.h
js/xpconnect/src/XPCLocale.cpp
layout/base/nsPresContext.cpp
layout/base/tests/test_bug399284.html
netwerk/base/src/nsStandardURL.cpp
netwerk/base/src/nsStandardURL.h
netwerk/base/src/nsUnicharStreamLoader.cpp
netwerk/streamconv/converters/nsIndexedToHTML.cpp
netwerk/streamconv/converters/nsIndexedToHTML.h
netwerk/test/unit/test_gre_resources.js
parser/html/nsHtml5StreamParser.cpp
widget/gtk/nsClipboard.cpp
widget/xpwidgets/nsPrimitiveHelpers.cpp
--- a/b2g/locales/jar.mn
+++ b/b2g/locales/jar.mn
@@ -52,20 +52,18 @@ relativesrcdir toolkit/locales:
 % override chrome://global/locale/crashes.dtd chrome://b2g-l10n/locale/overrides/crashreporter/crashes.dtd
 % override chrome://global/locale/crashes.properties chrome://b2g-l10n/locale/overrides/crashreporter/crashes.properties
 % override chrome://global/locale/mozilla.dtd chrome://b2g-l10n/locale/overrides/global/mozilla.dtd
 % override chrome://global/locale/aboutTelemetry.dtd chrome://b2g-l10n/locale/overrides/global/aboutTelemetry.dtd
 % override chrome://global/locale/aboutTelemetry.properties chrome://b2g-l10n/locale/overrides/global/aboutTelemetry.properties
 
 # overrides for dom l10n, also for en-US
 relativesrcdir dom/locales:
-  locale/@AB_CD@/b2g-l10n/overrides/charsetTitles.properties    (%chrome/charsetTitles.properties)
   locale/@AB_CD@/b2g-l10n/overrides/global.dtd                  (%chrome/global.dtd)
   locale/@AB_CD@/b2g-l10n/overrides/AccessFu.properties         (%chrome/accessibility/AccessFu.properties)
   locale/@AB_CD@/b2g-l10n/overrides/dom/dom.properties          (%chrome/dom/dom.properties)
 #about:plugins
   locale/@AB_CD@/b2g-l10n/overrides/plugins.properties          (%chrome/plugins.properties)
 
-% override chrome://global/locale/charsetTitles.properties chrome://b2g-l10n/locale/overrides/charsetTitles.properties
 % override chrome://global/locale/global.dtd chrome://b2g-l10n/locale/overrides/global.dtd
 % override chrome://global/locale/AccessFu.properties chrome://b2g-l10n/locale/overrides/AccessFu.properties
 % override chrome://global/locale/dom/dom.properties chrome://b2g-l10n/locale/overrides/dom/dom.properties
 % override chrome://global/locale/plugins.properties chrome://b2g-l10n/locale/overrides/plugins.properties
--- a/browser/components/customizableui/src/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/src/CustomizableWidgets.jsm
@@ -15,19 +15,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
   "resource:///modules/PlacesUIUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "RecentlyClosedTabsAndWindowsMenuUtils",
   "resource:///modules/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ShortcutUtils",
   "resource://gre/modules/ShortcutUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
   "resource://gre/modules/CharsetMenu.jsm");
-XPCOMUtils.defineLazyServiceGetter(this, "CharsetManager",
-                                   "@mozilla.org/charset-converter-manager;1",
-                                   "nsICharsetConverterManager");
 
 XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() {
   const kCharsetBundle = "chrome://global/locale/charsetMenu.properties";
   return Services.strings.createBundle(kCharsetBundle);
 });
 XPCOMUtils.defineLazyGetter(this, "BrandBundle", function() {
   const kBrandBundle = "chrome://branding/locale/brand.properties";
   return Services.strings.createBundle(kBrandBundle);
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -109,17 +109,16 @@
 #include "nsIScriptContext.h"
 #include "nsBindingManager.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsHTMLDocument.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIRequest.h"
 #include "nsHostObjectProtocolHandler.h"
 
-#include "nsCharsetAlias.h"
 #include "nsCharsetSource.h"
 #include "nsIParser.h"
 #include "nsIContentSink.h"
 
 #include "nsDateTimeFormatCID.h"
 #include "nsIDateTimeFormat.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventStates.h"
--- a/content/base/src/nsDocumentEncoder.cpp
+++ b/content/base/src/nsDocumentEncoder.cpp
@@ -8,35 +8,32 @@
  * to strings in a gazillion different ways.
  */
  
 #include "nsIDocumentEncoder.h"
 
 #include "nscore.h"
 #include "nsIFactory.h"
 #include "nsISupports.h"
-#include "nsIComponentManager.h" 
-#include "nsIServiceManager.h"
 #include "nsIDocument.h"
 #include "nsIHTMLDocument.h"
 #include "nsCOMPtr.h"
 #include "nsIContentSerializer.h"
 #include "nsIUnicodeEncoder.h"
 #include "nsIOutputStream.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMText.h"
 #include "nsIDOMCDATASection.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMDocumentType.h"
 #include "nsIDOMNodeList.h"
 #include "nsRange.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMDocument.h"
-#include "nsICharsetConverterManager.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
 #include "nsIParserService.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptSecurityManager.h"
 #include "mozilla/dom/Selection.h"
 #include "nsISelectionPrivate.h"
@@ -48,16 +45,17 @@
 #include "nsTArray.h"
 #include "nsIFrame.h"
 #include "nsStringBuffer.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "nsIEditor.h"
 #include "nsIHTMLEditor.h"
 #include "nsIDocShell.h"
+#include "mozilla/dom/EncodingUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsresult NS_NewDomSelection(nsISelection **aDomSelection);
 
 enum nsRangeIterationDirection {
   kDirectionOut = -1,
@@ -145,17 +143,16 @@ protected:
   nsCOMPtr<nsISelection>         mSelection;
   nsRefPtr<nsRange>              mRange;
   nsCOMPtr<nsINode>              mNode;
   nsCOMPtr<nsIOutputStream>      mStream;
   nsCOMPtr<nsIContentSerializer> mSerializer;
   nsCOMPtr<nsIUnicodeEncoder>    mUnicodeEncoder;
   nsCOMPtr<nsINode>              mCommonParent;
   nsCOMPtr<nsIDocumentEncoderNodeFixup> mNodeFixup;
-  nsCOMPtr<nsICharsetConverterManager> mCharsetConverterManager;
 
   nsString          mMimeType;
   nsCString         mCharset;
   uint32_t          mFlags;
   uint32_t          mWrapColumn;
   uint32_t          mStartDepth;
   uint32_t          mEndDepth;
   int32_t           mStartRootIndex;
@@ -1059,22 +1056,16 @@ nsDocumentEncoder::EncodeToStringWithMax
 
     mSerializer = do_CreateInstance(progId.get());
     NS_ENSURE_TRUE(mSerializer, NS_ERROR_NOT_IMPLEMENTED);
   }
 
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIAtom> charsetAtom;
-  if (!mCharset.IsEmpty()) {
-    if (!mCharsetConverterManager) {
-      mCharsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-  }
   
   bool rewriteEncodingDeclaration = !(mSelection || mRange || mNode) && !(mFlags & OutputDontRewriteEncodingDeclaration);
   mSerializer->Init(mFlags, mWrapColumn, mCharset.get(), mIsCopying, rewriteEncodingDeclaration);
 
   if (mSelection) {
     nsCOMPtr<nsIDOMRange> range;
     int32_t i, count = 0;
 
@@ -1199,24 +1190,21 @@ nsDocumentEncoder::EncodeToStringWithMax
 NS_IMETHODIMP
 nsDocumentEncoder::EncodeToStream(nsIOutputStream* aStream)
 {
   nsresult rv = NS_OK;
 
   if (!mDocument)
     return NS_ERROR_NOT_INITIALIZED;
 
-  if (!mCharsetConverterManager) {
-    mCharsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(mCharset, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
   }
-
-  rv = mCharsetConverterManager->GetUnicodeEncoder(mCharset.get(),
-                                                   getter_AddRefs(mUnicodeEncoder));
-  NS_ENSURE_SUCCESS(rv, rv);
+  mUnicodeEncoder = EncodingUtils::EncoderForEncoding(encoding);
 
   if (mMimeType.LowerCaseEqualsLiteral("text/plain")) {
     rv = mUnicodeEncoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nullptr, '?');
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   mStream = aStream;
 
--- a/dom/archivereader/ArchiveReader.cpp
+++ b/dom/archivereader/ArchiveReader.cpp
@@ -31,18 +31,18 @@ ArchiveReader::Constructor(const GlobalO
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
   if (!window) {
     aError.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   nsAutoCString encoding;
-  if (!EncodingUtils::FindEncodingForLabel(aOptions.mEncoding, encoding) ||
-      encoding.EqualsLiteral("replacement")) {
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(aOptions.mEncoding,
+                                                        encoding)) {
     aError.ThrowTypeError(MSG_ENCODING_NOT_SUPPORTED, &aOptions.mEncoding);
     return nullptr;
   }
 
   nsRefPtr<ArchiveReader> reader =
     new ArchiveReader(aBlob, window, encoding);
   return reader.forget();
 }
--- a/dom/encoding/EncodingUtils.cpp
+++ b/dom/encoding/EncodingUtils.cpp
@@ -12,16 +12,20 @@
 
 namespace mozilla {
 namespace dom {
 
 static const char* labelsEncodings[][3] = {
 #include "labelsencodings.properties.h"
 };
 
+static const char* encodingsGroups[][3] = {
+#include "encodingsgroups.properties.h"
+};
+
 bool
 EncodingUtils::FindEncodingForLabel(const nsACString& aLabel,
                                     nsACString& aOutEncoding)
 {
   // Save aLabel first because it may refer the same string as aOutEncoding.
   nsCString label(aLabel);
 
   EncodingUtils::TrimSpaceCharacters(label);
@@ -31,16 +35,30 @@ EncodingUtils::FindEncodingForLabel(cons
   }
 
   ToLowerCase(label);
   return NS_SUCCEEDED(nsUConvPropertySearch::SearchPropertyValue(
       labelsEncodings, ArrayLength(labelsEncodings), label, aOutEncoding));
 }
 
 bool
+EncodingUtils::FindEncodingForLabelNoReplacement(const nsACString& aLabel,
+                                                 nsACString& aOutEncoding)
+{
+  if(!FindEncodingForLabel(aLabel, aOutEncoding)) {
+    return false;
+  }
+  if (aOutEncoding.EqualsLiteral("replacement")) {
+    aOutEncoding.Truncate();
+    return false;
+  }
+  return true;
+}
+
+bool
 EncodingUtils::IsAsciiCompatible(const nsACString& aPreferredName)
 {
   return !(aPreferredName.LowerCaseEqualsLiteral("utf-16") ||
            aPreferredName.LowerCaseEqualsLiteral("utf-16be") ||
            aPreferredName.LowerCaseEqualsLiteral("utf-16le") ||
            aPreferredName.LowerCaseEqualsLiteral("replacement") ||
            aPreferredName.LowerCaseEqualsLiteral("hz-gb-2312") ||
            aPreferredName.LowerCaseEqualsLiteral("utf-7") ||
@@ -64,10 +82,20 @@ EncodingUtils::EncoderForEncoding(const 
   nsAutoCString contractId(NS_UNICODEENCODER_CONTRACTID_BASE);
   contractId.Append(aEncoding);
 
   nsCOMPtr<nsIUnicodeEncoder> encoder = do_CreateInstance(contractId.get());
   MOZ_ASSERT(encoder, "Tried to create encoder for unknown encoding.");
   return encoder.forget();
 }
 
+void
+EncodingUtils::LangGroupForEncoding(const nsACString& aEncoding,
+                                    nsACString& aOutGroup)
+{
+  if (NS_FAILED(nsUConvPropertySearch::SearchPropertyValue(
+      encodingsGroups, ArrayLength(encodingsGroups), aEncoding, aOutGroup))) {
+    aOutGroup.AssignLiteral("x-unicode");
+  }
+}
+
 } // namespace dom
 } // namespace mozilla
--- a/dom/encoding/EncodingUtils.h
+++ b/dom/encoding/EncodingUtils.h
@@ -22,30 +22,49 @@ public:
    * Implements get an encoding algorithm from Encoding spec.
    * http://encoding.spec.whatwg.org/#concept-encoding-get
    * Given a label, this function returns the corresponding encoding or a
    * false.
    * The returned name may not be lowercased due to compatibility with
    * our internal implementations.
    *
    * @param      aLabel, incoming label describing charset to be decoded.
-   * @param      aRetEncoding, returning corresponding encoding for label.
+   * @param      aOutEncoding, returning corresponding encoding for label.
    * @return     false if no encoding was found for label.
    *             true if valid encoding found.
    */
   static bool FindEncodingForLabel(const nsACString& aLabel,
                                    nsACString& aOutEncoding);
 
   static bool FindEncodingForLabel(const nsAString& aLabel,
                                    nsACString& aOutEncoding)
   {
     return FindEncodingForLabel(NS_ConvertUTF16toUTF8(aLabel), aOutEncoding);
   }
 
   /**
+   * Like FindEncodingForLabel() except labels that map to "replacement"
+   * are treated as unknown.
+   *
+   * @param      aLabel, incoming label describing charset to be decoded.
+   * @param      aOutEncoding, returning corresponding encoding for label.
+   * @return     false if no encoding was found for label.
+   *             true if valid encoding found.
+   */
+  static bool FindEncodingForLabelNoReplacement(const nsACString& aLabel,
+                                                nsACString& aOutEncoding);
+
+  static bool FindEncodingForLabelNoReplacement(const nsAString& aLabel,
+                                                nsACString& aOutEncoding)
+  {
+    return FindEncodingForLabelNoReplacement(NS_ConvertUTF16toUTF8(aLabel),
+                                             aOutEncoding);
+  }
+
+  /**
    * Remove any leading and trailing space characters, following the
    * definition of space characters from Encoding spec.
    * http://encoding.spec.whatwg.org/#terminology
    * Note that nsAString::StripWhitespace() doesn't exactly match the
    * definition. It also removes all matching chars in the string,
    * not just leading and trailing.
    *
    * @param      aString, string to be trimmed.
@@ -104,16 +123,26 @@ public:
    * Instantiates an encoder for an encoding. The input must be a
    * Gecko-canonical encoding name.
    * @param aEncoding a Gecko-canonical encoding name
    * @return an encoder
    */
   static already_AddRefed<nsIUnicodeEncoder>
   EncoderForEncoding(const nsACString& aEncoding);
 
+  /**
+   * Finds a Gecko language group string (e.g. x-western) for a Gecko-canonical
+   * encoding name.
+   *
+   * @param      aEncoding, incoming label describing charset to be decoded.
+   * @param      aOutGroup, returning corresponding language group.
+   */
+  static void LangGroupForEncoding(const nsACString& aEncoding,
+                                   nsACString& aOutGroup);
+
 private:
   EncodingUtils() MOZ_DELETE;
 };
 
 } // dom
 } // mozilla
 
 #endif // mozilla_dom_encodingutils_h_
--- a/dom/encoding/Makefile.in
+++ b/dom/encoding/Makefile.in
@@ -6,10 +6,12 @@ include $(topsrcdir)/config/rules.mk
 
 PROPS2ARRAYS = $(topsrcdir)/intl/locale/src/props2arrays.py
 labelsencodings.properties.h: $(PROPS2ARRAYS) labelsencodings.properties
 	$(PYTHON) $^ $@
 localesfallbacks.properties.h: $(PROPS2ARRAYS) localesfallbacks.properties
 	$(PYTHON) $^ $@
 domainsfallbacks.properties.h: $(PROPS2ARRAYS) domainsfallbacks.properties
 	$(PYTHON) $^ $@
+encodingsgroups.properties.h: $(PROPS2ARRAYS) encodingsgroups.properties
+	$(PYTHON) $^ $@
 nonparticipatingdomains.properties.h: $(PROPS2ARRAYS) nonparticipatingdomains.properties
 	$(PYTHON) $^ $@
--- a/dom/encoding/TextDecoder.cpp
+++ b/dom/encoding/TextDecoder.cpp
@@ -10,24 +10,22 @@ namespace mozilla {
 namespace dom {
 
 static const char16_t kReplacementChar = static_cast<char16_t>(0xFFFD);
 
 void
 TextDecoder::Init(const nsAString& aLabel, const bool aFatal,
                   ErrorResult& aRv)
 {
-  nsAutoString label(aLabel);
-  EncodingUtils::TrimSpaceCharacters(label);
-
   nsAutoCString encoding;
   // Let encoding be the result of getting an encoding from label.
   // If encoding is failure or replacement, throw a TypeError.
-  if (!EncodingUtils::FindEncodingForLabel(label, encoding) ||
-      encoding.EqualsLiteral("replacement")) {
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(aLabel, encoding)) {
+    nsAutoString label(aLabel);
+    EncodingUtils::TrimSpaceCharacters(label);
     aRv.ThrowTypeError(MSG_ENCODING_NOT_SUPPORTED, &label);
     return;
   }
   InitWithEncoding(encoding, aFatal);
 }
 
 void
 TextDecoder::InitWithEncoding(const nsACString& aEncoding, const bool aFatal)
new file mode 100644
--- /dev/null
+++ b/dom/encoding/encodingsgroups.properties
@@ -0,0 +1,43 @@
+# 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/.
+
+# x-unicode is assumed for encodings not listed here
+
+Big5=zh-TW
+Big5-HKSCS=zh=HK
+EUC-JP=ja
+EUC-KR=ko
+gb18030=zh-CN
+gbk=zh-CN
+HZ-GB-2312=zh-CN
+IBM866=x-cyrillic
+ISO-2022-JP=ja
+ISO-8859-3=x-western
+ISO-8859-4=x-baltic
+ISO-8859-5=x-cyrillic
+ISO-8859-6=ar
+ISO-8859-7=el
+ISO-8859-8=he
+ISO-8859-8-I=he
+ISO-8859-10=x-western
+ISO-8859-13=x-baltic
+ISO-8859-14=x-western
+ISO-8859-15=x-western
+ISO-8859-16=x-central-euro
+ISO-8859-2=x-central-euro
+KOI8-R=x-cyrillic
+KOI8-U=x-cyrillic
+Shift_JIS=ja
+windows-1250=x-central-euro
+windows-1251=x-cyrillic
+windows-1252=x-western
+windows-1253=el
+windows-1254=tr
+windows-1255=he
+windows-1256=ar
+windows-1257=x-baltic
+windows-1258=x-western
+windows-874=th
+x-mac-cyrillic=x-cyrillic
+
--- a/dom/encoding/moz.build
+++ b/dom/encoding/moz.build
@@ -24,12 +24,13 @@ FAIL_ON_WARNINGS = True
 
 FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/intl/locale/src',
 ]
 
 GENERATED_FILES += [
     'domainsfallbacks.properties.h',
+    'encodingsgroups.properties.h',
     'labelsencodings.properties.h',
     'localesfallbacks.properties.h',
     'nonparticipatingdomains.properties.h',
 ]
deleted file mode 100644
--- a/dom/locales/en-US/chrome/charsetTitles.properties
+++ /dev/null
@@ -1,104 +0,0 @@
-# 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/.
-
-## Rule of this file:
-## 1. key should always be in lower case ascii so we can do case insensitive
-##    comparison in the code faster.
-
-## Format of this file:
-## 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)
-iso-8859-4.title    = Baltic (ISO-8859-4)
-iso-8859-9.title    = Turkish (ISO-8859-9)
-iso-8859-10.title   = Nordic (ISO-8859-10)
-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)
-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)
-big5.title = Chinese Traditional (Big5)
-big5-hkscs.title = Chinese Traditional (Big5-HKSCS)
-x-euc-tw.title = Chinese Traditional (EUC-TW)
-gb2312.title = Chinese Simplified (GB2312)
-hz-gb-2312.title = Chinese Simplified (HZ)
-gbk.title = Chinese Simplified (GBK)
-iso-2022-cn.title = Chinese Simplified (ISO-2022-CN)
-euc-kr.title = Korean (EUC-KR)
-x-johab.title = Korean (JOHAB)
-iso-2022-kr.title = Korean (ISO-2022-KR)
-utf-7.title = Unicode (UTF-7)
-utf-8.title = Unicode (UTF-8)
-utf-16.title = Unicode (UTF-16)
-utf-16le.title = Unicode (UTF-16LE)
-utf-16be.title = Unicode (UTF-16BE)
-iso-8859-5.title = Cyrillic (ISO-8859-5)
-iso-ir-111.title = Cyrillic (ISO-IR-111)
-windows-1251.title = Cyrillic (Windows-1251)
-x-mac-cyrillic.title = Cyrillic (MacCyrillic)
-x-mac-ukrainian.title = Cyrillic/Ukrainian (MacUkrainian)
-koi8-r.title = Cyrillic (KOI8-R)
-koi8-u.title = Cyrillic/Ukrainian (KOI8-U)
-iso-8859-7.title = Greek (ISO-8859-7)
-windows-1253.title = Greek (Windows-1253)
-x-mac-greek.title = Greek (MacGreek)
-windows-1258.title = Vietnamese (Windows-1258)
-x-viet-tcvn5712.title = Vietnamese (TCVN)
-viscii.title = Vietnamese (VISCII)
-x-viet-vps.title = Vietnamese (VPS)
-tis-620.title = Thai (TIS-620)
-iso-8859-11.title = Thai (ISO-8859-11)
-windows-874.title = Thai (Windows-874)
-ibm874.title = Thai (IBM-874)
-armscii-8.title = Armenian (ARMSCII-8)
-iso-8859-6.title = Arabic (ISO-8859-6)
-iso-8859-6-i.title = Arabic (ISO-8859-6-I)
-iso-8859-6-e.title = Arabic (ISO-8859-6-E)
-iso-8859-8.title = Hebrew Visual (ISO-8859-8)
-iso-8859-8-i.title = Hebrew (ISO-8859-8-I)
-iso-8859-8-e.title = Hebrew (ISO-8859-8-E)
-windows-1255.title = Hebrew (Windows-1255)
-windows-1256.title = Arabic (Windows-1256)
-x-user-defined.title = User Defined
-ibm866.title = Cyrillic/Russian (CP-866)
-ibm850.title = Western (IBM-850)
-ibm852.title = Central European (IBM-852)
-ibm855.title = Cyrillic (IBM-855)
-ibm857.title = Turkish (IBM-857)
-ibm862.title = Hebrew (IBM-862)
-gb18030.title = Chinese Simplified (GB18030)
-x-mac-arabic.title = Arabic (MacArabic)
-x-mac-farsi.title = Farsi (MacFarsi)
-x-mac-hebrew.title = Hebrew (MacHebrew)
-x-mac-devanagari.title = Hindi (MacDevanagari)
-x-mac-gujarati.title = Gujarati (MacGujarati)
-x-mac-gurmukhi.title = Gurmukhi (MacGurmukhi)
-
-
-chardet.off.title                           = (Off)
-chardet.universal_charset_detector.title    = Universal
-chardet.ja_parallel_state_machine.title     = Japanese
-chardet.ko_parallel_state_machine.title     = Korean
-chardet.zhtw_parallel_state_machine.title   = Traditional Chinese
-chardet.zhcn_parallel_state_machine.title   = Simplified Chinese
-chardet.zh_parallel_state_machine.title     = Chinese
-chardet.cjk_parallel_state_machine.title    = East Asian
-chardet.ruprob.title                        = Russian
-chardet.ukprob.title                        = Ukrainian
--- a/dom/locales/jar.mn
+++ b/dom/locales/jar.mn
@@ -9,17 +9,16 @@
   locale/@AB_CD@/global/xbl.properties                         (%chrome/layout/xbl.properties)
   locale/@AB_CD@/global/xul.properties                         (%chrome/layout/xul.properties)
   locale/@AB_CD@/global/printing.properties                    (%chrome/layout/printing.properties)
   locale/@AB_CD@/global/layout_errors.properties               (%chrome/layout/layout_errors.properties)
   locale/@AB_CD@/global/netError.dtd                           (%chrome/netError.dtd)
   locale/@AB_CD@/global/netErrorApp.dtd                        (%chrome/netErrorApp.dtd)
   locale/@AB_CD@/global/global.dtd                             (%chrome/global.dtd)
   locale/@AB_CD@/global/appstrings.properties                  (%chrome/appstrings.properties)
-  locale/@AB_CD@/global/charsetTitles.properties               (%chrome/charsetTitles.properties)
   locale/@AB_CD@/global/global-strres.properties               (%chrome/global-strres.properties)
   locale/@AB_CD@/global/plugins.properties                     (%chrome/plugins.properties)
   locale/@AB_CD@/global/nsWebBrowserPersist.properties         (%chrome/nsWebBrowserPersist.properties)
   locale/@AB_CD@/global/xslt/xslt.properties                   (%chrome/xslt/xslt.properties)
   locale/@AB_CD@/global/dom/dom.properties                     (%chrome/dom/dom.properties)
   locale/@AB_CD@/global/svg/svg.properties                     (%chrome/svg/svg.properties)
   locale/@AB_CD@/global/layout/MediaDocument.properties        (%chrome/layout/MediaDocument.properties)
   locale/@AB_CD@/global/layout/htmlparser.properties           (%chrome/layout/htmlparser.properties)
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -3,28 +3,28 @@
  * 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 "nsPluginTags.h"
 
 #include "prlink.h"
 #include "plstr.h"
 #include "nsIPluginInstanceOwner.h"
-#include "nsServiceManagerUtils.h"
 #include "nsPluginsDir.h"
 #include "nsPluginHost.h"
 #include "nsIBlocklistService.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsIPlatformCharset.h"
-#include "nsICharsetConverterManager.h"
 #include "nsPluginLogging.h"
 #include "nsNPAPIPlugin.h"
 #include "mozilla/Preferences.h"
 #include <cctype>
+#include "mozilla/dom/EncodingUtils.h"
 
+using mozilla::dom::EncodingUtils;
 using namespace mozilla;
 
 // These legacy flags are used in the plugin registry. The states are now
 // stored in prefs, but we still need to be able to import them.
 #define NS_PLUGIN_FLAG_ENABLED      0x0001    // is this plugin enabled?
 // no longer used                   0x0002    // reuse only if regenerating pluginreg.dat
 #define NS_PLUGIN_FLAG_FROMCACHE    0x0004    // this plugintag info was loaded from cache
 // no longer used                   0x0008    // reuse only if regenerating pluginreg.dat
@@ -231,40 +231,33 @@ nsresult nsPluginTag::EnsureMembersAreUT
   return NS_OK;
 #else
   nsresult rv;
   
   nsCOMPtr<nsIPlatformCharset> pcs =
   do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIUnicodeDecoder> decoder;
-  nsCOMPtr<nsICharsetConverterManager> ccm =
-  do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  
+
   nsAutoCString charset;
   rv = pcs->GetCharset(kPlatformCharsetSel_FileName, charset);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!charset.LowerCaseEqualsLiteral("utf-8")) {
-    rv = ccm->GetUnicodeDecoderRaw(charset.get(), getter_AddRefs(decoder));
-    NS_ENSURE_SUCCESS(rv, rv);
-    
+    decoder = EncodingUtils::DecoderForEncoding(charset);
     ConvertToUTF8(decoder, mFileName);
     ConvertToUTF8(decoder, mFullPath);
   }
   
   // The description of the plug-in and the various MIME type descriptions
   // should be encoded in the standard plain text file encoding for this system.
   // XXX should we add kPlatformCharsetSel_PluginResource?
   rv = pcs->GetCharset(kPlatformCharsetSel_PlainTextInFile, charset);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!charset.LowerCaseEqualsLiteral("utf-8")) {
-    rv = ccm->GetUnicodeDecoderRaw(charset.get(), getter_AddRefs(decoder));
-    NS_ENSURE_SUCCESS(rv, rv);
-    
+    decoder = EncodingUtils::DecoderForEncoding(charset);
     ConvertToUTF8(decoder, mName);
     ConvertToUTF8(decoder, mDescription);
     for (uint32_t i = 0; i < mMimeDescriptions.Length(); ++i) {
       ConvertToUTF8(decoder, mMimeDescriptions[i]);
     }
   }
   return NS_OK;
 #endif
--- a/extensions/spellcheck/hunspell/src/csutil.cpp
+++ b/extensions/spellcheck/hunspell/src/csutil.cpp
@@ -78,23 +78,22 @@ struct unicode_info {
 #  ifndef MOZILLA_CLIENT
 #    include "utf_info.cxx"
 #    define UTF_LST_LEN (sizeof(utf_lst) / (sizeof(unicode_info)))
 #  endif
 #endif
 
 #ifdef MOZILLA_CLIENT
 #include "nsCOMPtr.h"
-#include "nsServiceManagerUtils.h"
 #include "nsIUnicodeEncoder.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsUnicharUtils.h"
-#include "nsICharsetConverterManager.h"
+#include "mozilla/dom/EncodingUtils.h"
 
-static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
+using mozilla::dom::EncodingUtils;
 #endif
 
 struct unicode_info2 {
   char cletter;
   unsigned short cupper;
   unsigned short clower;
 };
 
@@ -5531,32 +5530,27 @@ struct cs_info * get_current_cs(const ch
     ccs[i].clower = i;
     ccs[i].cupper = i;
   }
 
   nsCOMPtr<nsIUnicodeEncoder> encoder; 
   nsCOMPtr<nsIUnicodeDecoder> decoder; 
 
   nsresult rv;
-  nsCOMPtr<nsICharsetConverterManager> ccm = do_GetService(kCharsetConverterManagerCID, &rv);
-  if (NS_FAILED(rv))
+
+  nsAutoCString label(es);
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
     return ccs;
-
-  rv = ccm->GetUnicodeEncoder(es, getter_AddRefs(encoder));
-  if (NS_FAILED(rv))
-    return ccs;
+  }
+  encoder = EncodingUtils::EncoderForEncoding(encoding);
+  decoder = EncodingUtils::DecoderForEncoding(encoding);
   encoder->SetOutputErrorBehavior(encoder->kOnError_Signal, nullptr, '?');
-  rv = ccm->GetUnicodeDecoder(es, getter_AddRefs(decoder));
-  if (NS_FAILED(rv))
-    return ccs;
   decoder->SetInputErrorBehavior(decoder->kOnError_Signal);
 
-  if (NS_FAILED(rv))
-    return ccs;
-
   for (unsigned int i = 0; i <= 0xff; ++i) {
     bool success = false;
     // We want to find the upper/lowercase equivalents of each byte
     // in this 1-byte character encoding.  Call our encoding/decoding
     // APIs separately for each byte since they may reject some of the
     // bytes, and we want to handle errors separately for each byte.
     char lower, upper;
     do {
--- a/extensions/spellcheck/hunspell/src/mozHunspell.cpp
+++ b/extensions/spellcheck/hunspell/src/mozHunspell.cpp
@@ -62,25 +62,27 @@
 #include "nsXPIDLString.h"
 #include "nsIObserverService.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsIFile.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "mozISpellI18NManager.h"
-#include "nsICharsetConverterManager.h"
 #include "nsUnicharUtilCIID.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "mozInlineSpellChecker.h"
 #include "mozilla/Services.h"
 #include <stdlib.h>
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozHunspell)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozHunspell)
 
 NS_INTERFACE_MAP_BEGIN(mozHunspell)
   NS_INTERFACE_MAP_ENTRY(mozISpellCheckingEngine)
@@ -200,28 +202,23 @@ NS_IMETHODIMP mozHunspell::SetDictionary
   mDictionary = aDictionary;
   mAffixFileName = affFileName;
 
   mHunspell = new Hunspell(affFileName.get(),
                          dictFileName.get());
   if (!mHunspell)
     return NS_ERROR_OUT_OF_MEMORY;
 
-  nsCOMPtr<nsICharsetConverterManager> ccm =
-    do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = ccm->GetUnicodeDecoder(mHunspell->get_dic_encoding(),
-                              getter_AddRefs(mDecoder));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = ccm->GetUnicodeEncoder(mHunspell->get_dic_encoding(),
-                              getter_AddRefs(mEncoder));
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  nsDependentCString label(mHunspell->get_dic_encoding());
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
+  }
+  mEncoder = EncodingUtils::EncoderForEncoding(encoding);
+  mDecoder = EncodingUtils::DecoderForEncoding(encoding);
 
   if (mEncoder)
     mEncoder->SetOutputErrorBehavior(mEncoder->kOnError_Signal, nullptr, '?');
 
   int32_t pos = mDictionary.FindChar('-');
   if (pos == -1)
     pos = mDictionary.FindChar('_');
 
--- a/extensions/spellcheck/src/mozPersonalDictionary.cpp
+++ b/extensions/spellcheck/src/mozPersonalDictionary.cpp
@@ -3,17 +3,16 @@
  * 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 "mozPersonalDictionary.h"
 #include "nsIUnicharInputStream.h"
 #include "nsReadableUtils.h"
 #include "nsIFile.h"
 #include "nsAppDirectoryServiceDefs.h"
-#include "nsICharsetConverterManager.h"
 #include "nsIObserverService.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIWeakReference.h"
 #include "nsCRT.h"
 #include "nsNetUtil.h"
 #include "nsStringEnumerator.h"
 #include "nsUnicharInputStream.h"
--- a/intl/build/nsI18nModule.cpp
+++ b/intl/build/nsI18nModule.cpp
@@ -23,17 +23,16 @@
 // string bundles (intl)
 #include "nsStringBundleService.h"
 #include "nsStringBundleTextOverride.h"
 
 // locale
 #include "nsLocaleConstructors.h"
 
 // uconv
-#include "nsCharsetConverterManager.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsJISx4051LineBreaker)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSampleWordBreaker)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSemanticUnitScanner)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStringBundleService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStringBundleTextOverride, Init)
@@ -130,25 +129,19 @@ static const mozilla::Module::ContractID
 #endif
 #ifdef USE_MAC_LOCALE
     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
 #endif
     { nullptr }
 };
 
-static void
-I18nModuleDtor()
-{
-    nsCharsetConverterManager::Shutdown();
-}
-
 static const mozilla::Module kIntlModule = {
     mozilla::Module::kVersion,
     kIntlCIDs,
     kIntlContracts,
     nullptr,
     nullptr,
     nullptr,
-    I18nModuleDtor
+    nullptr
 };
 
 NSMODULE_DEFN(nsI18nModule) = &kIntlModule;
--- a/intl/locale/public/moz.build
+++ b/intl/locale/public/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 EXPORTS += [
-    'nsCharsetAlias.h',
     'nsCollationCID.h',
     'nsDateTimeFormatCID.h',
     'nsIDateTimeFormat.h',
     'nsILanguageAtomService.h',
     'nsIPlatformCharset.h',
     'nsPosixLocale.h',
     'nsWin32Locale.h',
 ]
deleted file mode 100644
--- a/intl/locale/public/nsCharsetAlias.h
+++ /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/. */
-
-#ifndef nsCharsetAlias_h___
-#define nsCharsetAlias_h___
-
-#include "nscore.h"
-#include "nsString.h"
-
-class nsCharsetConverterManager;
-class nsScriptableUnicodeConverter;
-
-class nsCharsetAlias
-{
-   friend class nsCharsetConverterManager;
-   friend class nsScriptableUnicodeConverter;
-   static nsresult GetPreferredInternal(const nsACString& aAlias, nsACString& aResult);
-public:
-   static nsresult GetPreferred(const nsACString& aAlias, nsACString& aResult);
-   static nsresult Equals(const nsACString& aCharset1, const nsACString& aCharset2, bool* aResult);
-};
-
-#endif /* nsCharsetAlias_h___ */
--- a/intl/locale/public/nsILanguageAtomService.h
+++ b/intl/locale/public/nsILanguageAtomService.h
@@ -12,31 +12,31 @@
  * to language groups, and access to the system locale language.
  */
 
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 
 #define NS_ILANGUAGEATOMSERVICE_IID \
-  {0xAF4C48CF, 0x8F76, 0x4477, \
-    { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }}
+  {0xcb3892a0, 0x6a76, 0x461c, \
+    { 0xb0, 0x24, 0x23, 0x0e, 0xe3, 0xe0, 0x81, 0x1a }}
 
 #define NS_LANGUAGEATOMSERVICE_CONTRACTID \
   "@mozilla.org/intl/nslanguageatomservice;1"
 
 class nsILanguageAtomService : public nsISupports
 {
  public: 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID)
 
   virtual nsIAtom* LookupLanguage(const nsACString &aLanguage,
                                   nsresult *aError = nullptr) = 0;
   virtual already_AddRefed<nsIAtom>
-  LookupCharSet(const char *aCharSet, nsresult *aError = nullptr) = 0;
+  LookupCharSet(const nsACString& aCharSet) = 0;
 
   virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nullptr) = 0;
 
   virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage,
                                     nsresult *aError = nullptr) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsILanguageAtomService,
--- a/intl/locale/src/Makefile.in
+++ b/intl/locale/src/Makefile.in
@@ -4,11 +4,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 ifeq ($(MOZ_WIDGET_TOOLKIT), qt)
 OS_INCLUDES	+= $(MOZ_QT_CFLAGS)
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-charsetalias.properties.h: props2arrays.py charsetalias.properties
-	$(PYTHON) $^ $@
-
deleted file mode 100644
--- a/intl/locale/src/charsetalias.properties
+++ /dev/null
@@ -1,460 +0,0 @@
-# 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/.
-#
-# This Original Code has been modified by IBM Corporation.
-# Modifications made by IBM described herein are
-# Copyright (c) International Business Machines
-# Corporation, 1999
-#
-# Modifications to Mozilla code or documentation
-# identified per MPL Section 3.3
-#
-# Date         Modified by     Description of modification
-# 12/09/1999   IBM Corp.       Support for IBM codepages - 850,852,855,857,862,864
-#
-# Rule of this file:
-# 1. key should always be in lower case ascii so we can do case insensitive
-#    comparison in the code faster.
-# 2. value should be the one used in unicode converter
-#
-# 3. If the charset is not used for document charset, but font charset
-#    (e.g. XLFD charset- such as JIS x0201, JIS x0208), don't put here
-#
-
-ascii=us-ascii
-us-ascii=us-ascii
-ansi_x3.4-1968=us-ascii
-646=us-ascii
-iso-8859-1=ISO-8859-1
-iso-8859-2=ISO-8859-2
-iso-8859-3=ISO-8859-3
-iso-8859-4=ISO-8859-4
-iso-8859-5=ISO-8859-5
-iso-8859-6=ISO-8859-6
-iso-8859-6-i=ISO-8859-6-I
-iso-8859-6-e=ISO-8859-6-E
-iso-8859-7=ISO-8859-7
-iso-8859-8=ISO-8859-8
-iso-8859-8-i=ISO-8859-8-I
-iso-8859-8-e=ISO-8859-8-E
-iso-8859-9=ISO-8859-9
-iso-8859-10=ISO-8859-10
-iso-8859-11=ISO-8859-11
-iso-8859-13=ISO-8859-13
-iso-8859-14=ISO-8859-14
-iso-8859-15=ISO-8859-15
-iso-8859-16=ISO-8859-16
-iso-ir-111=ISO-IR-111
-iso-2022-cn=ISO-2022-CN
-iso-2022-cn-ext=ISO-2022-CN
-iso-2022-kr=ISO-2022-KR
-iso-2022-jp=ISO-2022-JP
-utf-16be=UTF-16BE
-utf-16le=UTF-16LE
-utf-16=UTF-16
-windows-1250=windows-1250
-windows-1251=windows-1251
-windows-1252=windows-1252
-windows-1253=windows-1253
-windows-1254=windows-1254
-windows-1255=windows-1255
-windows-1256=windows-1256
-windows-1257=windows-1257
-windows-1258=windows-1258
-ibm866=IBM866
-ibm850=IBM850
-ibm852=IBM852
-ibm855=IBM855
-ibm857=IBM857
-ibm862=IBM862
-ibm864=IBM864
-utf-8=UTF-8
-utf-7=UTF-7
-shift_jis=Shift_JIS
-big5=Big5
-euc-jp=EUC-JP
-euc-kr=EUC-KR
-gb2312=GB2312
-gb18030=gb18030
-viscii=VISCII
-koi8-r=KOI8-R
-koi8_r=KOI8-R
-cskoi8r=KOI8-R
-koi=KOI8-R
-koi8=KOI8-R
-koi8-u=KOI8-U
-tis-620=TIS-620
-t.61-8bit=T.61-8bit
-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-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
-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
-armscii-8=armscii-8
-x-viet-tcvn5712=x-viet-tcvn5712
-x-viet-vps=x-viet-vps
-iso-10646-ucs-2=UTF-16BE
-x-iso-10646-ucs-2-be=UTF-16BE
-x-iso-10646-ucs-2-le=UTF-16LE
-x-user-defined=x-user-defined
-x-johab=x-johab
-#
-# Aliases for ISO-8859-1
-#
-latin1=ISO-8859-1
-iso_8859-1=ISO-8859-1
-iso8859-1=ISO-8859-1
-iso8859-2=ISO-8859-2
-iso8859-3=ISO-8859-3
-iso8859-4=ISO-8859-4
-iso8859-5=ISO-8859-5
-iso8859-6=ISO-8859-6
-iso8859-7=ISO-8859-7
-iso8859-8=ISO-8859-8
-iso8859-9=ISO-8859-9
-iso8859-10=ISO-8859-10
-iso8859-11=ISO-8859-11
-iso8859-13=ISO-8859-13
-iso8859-14=ISO-8859-14
-iso8859-15=ISO-8859-15
-iso_8859-1:1987=ISO-8859-1
-iso-ir-100=ISO-8859-1
-l1=ISO-8859-1
-ibm819=ISO-8859-1
-cp819=ISO-8859-1
-csisolatin1=ISO-8859-1
-#
-# Aliases for ISO-8859-2
-#
-latin2=ISO-8859-2
-iso_8859-2=ISO-8859-2
-iso_8859-2:1987=ISO-8859-2
-iso-ir-101=ISO-8859-2
-l2=ISO-8859-2
-csisolatin2=ISO-8859-2
-#
-# Aliases for ISO-8859-3
-#
-latin3=ISO-8859-3
-iso_8859-3=ISO-8859-3
-iso_8859-3:1988=ISO-8859-3
-iso-ir-109=ISO-8859-3
-l3=ISO-8859-3
-csisolatin3=ISO-8859-3
-#
-# Aliases for ISO-8859-4
-#
-latin4=ISO-8859-4
-iso_8859-4=ISO-8859-4
-iso_8859-4:1988=ISO-8859-4
-iso-ir-110=ISO-8859-4
-l4=ISO-8859-4
-csisolatin4=ISO-8859-4
-#
-# Aliases for ISO-8859-5
-#
-cyrillic=ISO-8859-5
-iso_8859-5=ISO-8859-5
-iso_8859-5:1988=ISO-8859-5
-iso-ir-144=ISO-8859-5
-csisolatincyrillic=ISO-8859-5
-#
-# Aliases for ISO-8859-6
-#
-arabic=ISO-8859-6
-iso_8859-6=ISO-8859-6
-iso_8859-6:1987=ISO-8859-6
-iso-ir-127=ISO-8859-6
-ecma-114=ISO-8859-6
-asmo-708=ISO-8859-6
-csisolatinarabic=ISO-8859-6
-#
-# Aliases for ISO-8859-6-I
-#
-csiso88596i=ISO-8859-6-I
-#
-# Aliases for ISO-8859-6-E
-#
-csiso88596e=ISO-8859-6-E
-#
-# Aliases for ISO-8859-7
-#
-greek=ISO-8859-7
-greek8=ISO-8859-7
-sun_eu_greek=ISO-8859-7
-iso_8859-7=ISO-8859-7
-iso_8859-7:1987=ISO-8859-7
-iso-ir-126=ISO-8859-7
-elot_928=ISO-8859-7
-ecma-118=ISO-8859-7
-csisolatingreek=ISO-8859-7
-#
-# Aliases for ISO-8859-8
-#
-hebrew=ISO-8859-8
-iso_8859-8=ISO-8859-8
-visual=ISO-8859-8
-iso_8859-8:1988=ISO-8859-8
-iso-ir-138=ISO-8859-8
-csisolatinhebrew=ISO-8859-8
-#
-# Aliases for ISO-8859-8-I
-#
-csiso88598i=ISO-8859-8-I
-iso-8859-8i=ISO-8859-8-I
-logical=ISO-8859-8-I
-#
-# Aliases for ISO-8859-8-E
-#
-csiso88598e=ISO-8859-8-E
-#
-# Aliases for ISO-8859-9
-#
-latin5=ISO-8859-9
-iso_8859-9=ISO-8859-9
-iso_8859-9:1989=ISO-8859-9
-iso-ir-148=ISO-8859-9
-l5=ISO-8859-9
-csisolatin5=ISO-8859-9
-#
-# Aliases for UTF-8
-#
-unicode-1-1-utf-8=UTF-8
-# nl_langinfo(CODESET) in HP/UX returns 'utf8' under UTF-8 locales
-utf8=UTF-8
-#
-# Aliases for Shift_JIS
-#
-x-sjis=Shift_JIS
-shift-jis=Shift_JIS
-ms_kanji=Shift_JIS
-csshiftjis=Shift_JIS
-windows-31j=Shift_JIS
-cp932=Shift_JIS
-sjis=Shift_JIS
-#
-# Aliases for EUC_JP
-#
-cseucpkdfmtjapanese=EUC-JP
-x-euc-jp=EUC-JP
-#
-# Aliases for ISO-2022-JP
-#
-csiso2022jp=ISO-2022-JP
-# The following are really not aliases ISO-2022-JP, but sharing the same decoder
-iso-2022-jp-2=ISO-2022-JP
-csiso2022jp2=ISO-2022-JP
-#
-# Aliases for Big5
-#
-csbig5=Big5
-cn-big5=Big5
-# x-x-big5 is not really a alias for Big5, add it only for MS FrontPage
-x-x-big5=Big5
-# Sun Solaris
-zh_tw-big5=Big5
-#
-# Aliases for EUC-KR
-#
-cseuckr=EUC-KR
-ks_c_5601-1987=EUC-KR
-iso-ir-149=EUC-KR
-ks_c_5601-1989=EUC-KR
-ksc_5601=EUC-KR
-ksc5601=EUC-KR
-korean=EUC-KR
-csksc56011987=EUC-KR
-5601=EUC-KR
-windows-949=EUC-KR
-#
-# Aliases for GB2312
-#
-# The following are really not aliases GB2312, add them only for MS FrontPage
-gb_2312-80=GB2312
-iso-ir-58=GB2312
-chinese=GB2312
-csiso58gb231280=GB2312
-csgb2312=GB2312
-zh_cn.euc=GB2312
-# Sun Solaris
-gb_2312=GB2312
-#
-# Aliases for windows-125x 
-#
-x-cp1250=windows-1250
-x-cp1251=windows-1251
-x-cp1252=windows-1252
-x-cp1253=windows-1253
-x-cp1254=windows-1254
-x-cp1255=windows-1255
-x-cp1256=windows-1256
-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 macintosh
-#
-macintosh=macintosh
-x-mac-roman=macintosh
-mac=macintosh
-csmacintosh=macintosh
-#
-# Aliases for IBM866
-#
-cp866=IBM866
-cp-866=IBM866
-866=IBM866
-csibm866=IBM866
-#
-# Aliases for IBM850
-#
-cp850=IBM850
-850=IBM850
-csibm850=IBM850
-#
-# Aliases for IBM852
-#
-cp852=IBM852
-852=IBM852
-csibm852=IBM852
-#
-# Aliases for IBM855
-#
-cp855=IBM855
-855=IBM855
-csibm855=IBM855
-#
-# Aliases for IBM857
-#
-cp857=IBM857
-857=IBM857
-csibm857=IBM857
-#
-# Aliases for IBM862
-#
-cp862=IBM862
-862=IBM862
-csibm862=IBM862
-#
-# Aliases for IBM864
-#
-cp864=IBM864
-864=IBM864
-csibm864=IBM864
-ibm-864=IBM864
-#
-# Aliases for T.61-8bit
-#
-t.61=T.61-8bit
-iso-ir-103=T.61-8bit
-csiso103t618bit=T.61-8bit
-#
-# Aliases for UTF-7
-#
-x-unicode-2-0-utf-7=UTF-7
-unicode-2-0-utf-7=UTF-7
-unicode-1-1-utf-7=UTF-7
-csunicode11utf7=UTF-7
-#
-# Aliases for ISO-10646-UCS-2
-#
-csunicode=UTF-16BE
-csunicode11=UTF-16BE
-iso-10646-ucs-basic=UTF-16BE
-csunicodeascii=UTF-16BE
-iso-10646-unicode-latin1=UTF-16BE
-csunicodelatin1=UTF-16BE
-iso-10646=UTF-16BE
-iso-10646-j-1=UTF-16BE
-#
-# Aliases for ISO-8859-10
-#
-latin6=ISO-8859-10
-iso-ir-157=ISO-8859-10
-l6=ISO-8859-10
-# Currently .properties cannot handle : in key
-#iso_8859-10:1992=ISO-8859-10
-csisolatin6=ISO-8859-10
-#
-# Aliases for ISO-8859-15
-#
-iso_8859-15=ISO-8859-15
-csisolatin9=ISO-8859-15
-l9=ISO-8859-15
-#
-# Aliases for ISO-IR-111
-#
-ecma-cyrillic=ISO-IR-111
-csiso111ecmacyrillic=ISO-IR-111
-#
-# Aliases for ISO-2022-KR
-#
-csiso2022kr=ISO-2022-KR
-#
-# Aliases for VISCII
-#
-csviscii=VISCII
-#
-# Aliases for x-euc-tw
-#
-zh_tw-euc=x-euc-tw
-#
-# Following names appears in unix nl_langinfo(CODESET)
-# They can be compiled as platform specific if necessary
-# DONT put things here if it does not look generic enough (like hp15CN)
-#
-iso88591=ISO-8859-1
-iso88592=ISO-8859-2
-iso88593=ISO-8859-3
-iso88594=ISO-8859-4
-iso88595=ISO-8859-5
-iso88596=ISO-8859-6
-iso88597=ISO-8859-7
-iso88598=ISO-8859-8
-iso88599=ISO-8859-9
-iso885910=ISO-8859-10
-iso885911=ISO-8859-11
-iso885912=ISO-8859-12
-iso885913=ISO-8859-13
-iso885914=ISO-8859-14
-iso885915=ISO-8859-15
-#
-tis620=TIS-620
-#
-cp1250=windows-1250
-cp1251=windows-1251
-cp1252=windows-1252
-cp1253=windows-1253
-cp1254=windows-1254
-cp1255=windows-1255
-cp1256=windows-1256
-cp1257=windows-1257
-cp1258=windows-1258
-
-x-gbk=gbk
-windows-936=gbk
-ansi-1251=windows-1251
--- a/intl/locale/src/moz.build
+++ b/intl/locale/src/moz.build
@@ -13,37 +13,32 @@ elif toolkit == 'cocoa':
 else:
     DIRS += ['unix']
 
 EXPORTS += [
     'nsCollation.h',
 ]
 
 UNIFIED_SOURCES += [
-    'nsCharsetAlias.cpp',
     'nsCollation.cpp',
     'nsLanguageAtomService.cpp',
     'nsLocale.cpp',
     'nsLocaleService.cpp',
     'nsScriptableDateFormat.cpp',
     'nsUConvPropertySearch.cpp',
 ]
 
 EXTRA_JS_MODULES += [
     'PluralForm.jsm',
 ]
 
 MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'i18n'
 
-GENERATED_FILES = [
-    'charsetalias.properties.h',
-]
-
 LOCAL_INCLUDES += [
     '/intl/uconv/src',
 ]
 
 RESOURCE_FILES += [
     'langGroups.properties',
     'language.properties',
 ]
deleted file mode 100644
--- a/intl/locale/src/nsCharsetAlias.cpp
+++ /dev/null
@@ -1,84 +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 "mozilla/ArrayUtils.h"
-
-#include "nsCharsetAlias.h"
-
-// for NS_ERROR_UCONV_NOCONV
-#include "nsCharsetConverterManager.h"
-
-#include "nsUConvPropertySearch.h"
-
-using namespace mozilla;
-
-// 
-static const char* kAliases[][3] = {
-#include "charsetalias.properties.h"
-};
-
-//--------------------------------------------------------------
-// static
-nsresult
-nsCharsetAlias::GetPreferredInternal(const nsACString& aAlias,
-                                     nsACString& oResult)
-{
-   nsAutoCString key(aAlias);
-   ToLowerCase(key);
-
-   return nsUConvPropertySearch::SearchPropertyValue(kAliases,
-      ArrayLength(kAliases), key, oResult);
-}
-
-//--------------------------------------------------------------
-// static
-nsresult
-nsCharsetAlias::GetPreferred(const nsACString& aAlias,
-                             nsACString& oResult)
-{
-   if (aAlias.IsEmpty()) return NS_ERROR_NULL_POINTER;
-
-   nsresult res = GetPreferredInternal(aAlias, oResult);
-   if (NS_FAILED(res))
-      return res;
-
-   if (nsCharsetConverterManager::IsInternal(oResult))
-      return NS_ERROR_UCONV_NOCONV;
-
-   return res;
-}
-
-//--------------------------------------------------------------
-// static
-nsresult
-nsCharsetAlias::Equals(const nsACString& aCharset1,
-                       const nsACString& aCharset2, bool* oResult)
-{
-   nsresult res = NS_OK;
-
-   if(aCharset1.Equals(aCharset2, nsCaseInsensitiveCStringComparator())) {
-      *oResult = true;
-      return res;
-   }
-
-   if(aCharset1.IsEmpty() || aCharset2.IsEmpty()) {
-      *oResult = false;
-      return res;
-   }
-
-   *oResult = false;
-   nsAutoCString name1;
-   res = GetPreferredInternal(aCharset1, name1);
-   if (NS_FAILED(res))
-     return res;
-
-   nsAutoCString name2;
-   res = GetPreferredInternal(aCharset2, name2);
-   if (NS_FAILED(res))
-     return res;
-
-   *oResult = name1.Equals(name2);
-   return NS_OK;
-}
--- a/intl/locale/src/nsCollation.cpp
+++ b/intl/locale/src/nsCollation.cpp
@@ -3,18 +3,20 @@
  * 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 "nsCollation.h"
 #include "nsCollationCID.h"
 #include "nsUnicharUtils.h"
 #include "prmem.h"
 #include "nsIUnicodeEncoder.h"
-#include "nsICharsetConverterManager.h"
 #include "nsServiceManagerUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_DEFINE_CID(kCollationCID, NS_COLLATION_CID);
 
 NS_IMPL_ISUPPORTS(nsCollationFactory, nsICollationFactory)
 
 nsresult nsCollationFactory::CreateCollation(nsILocale* locale, nsICollation** instancePtr)
@@ -68,23 +70,23 @@ nsresult nsCollation::NormalizeString(co
   }
   return NS_OK;
 }
 
 nsresult nsCollation::SetCharset(const char* aCharset)
 {
   NS_ENSURE_ARG_POINTER(aCharset);
 
-  nsresult rv;
-  nsCOMPtr <nsICharsetConverterManager> charsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  if (NS_SUCCEEDED(rv)) {
-    rv = charsetConverterManager->GetUnicodeEncoder(aCharset,
-                                                    getter_AddRefs(mEncoder));
+  nsDependentCString label(aCharset);
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
+      return NS_ERROR_UCONV_NOCONV;
   }
-  return rv;
+  mEncoder = EncodingUtils::EncoderForEncoding(encoding);
+  return NS_OK;
 }
 
 nsresult nsCollation::UnicodeToChar(const nsAString& aSrc, char** dst)
 {
   NS_ENSURE_ARG_POINTER(dst);
 
   nsresult res = NS_OK;
   if (!mEncoder)
--- a/intl/locale/src/nsLanguageAtomService.cpp
+++ b/intl/locale/src/nsLanguageAtomService.cpp
@@ -1,20 +1,20 @@
 /* -*- 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 "nsLanguageAtomService.h"
-#include "nsICharsetConverterManager.h"
 #include "nsILocaleService.h"
 #include "nsUnicharUtils.h"
 #include "nsIAtom.h"
 #include "mozilla/Services.h"
 #include "nsServiceManagerUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
 
 NS_IMPL_ISUPPORTS(nsLanguageAtomService, nsILanguageAtomService)
 
 nsLanguageAtomService::nsLanguageAtomService()
 {
 }
 
 nsresult
@@ -39,41 +39,21 @@ nsLanguageAtomService::LookupLanguage(co
   nsAutoCString lowered(aLanguage);
   ToLowerCase(lowered);
 
   nsCOMPtr<nsIAtom> lang = do_GetAtom(lowered);
   return GetLanguageGroup(lang, aError);
 }
 
 already_AddRefed<nsIAtom>
-nsLanguageAtomService::LookupCharSet(const char *aCharSet, nsresult *aError)
+nsLanguageAtomService::LookupCharSet(const nsACString& aCharSet)
 {
-  if (!mCharSets) {
-    mCharSets = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID);
-    if (!mCharSets) {
-      if (aError)
-        *aError = NS_ERROR_FAILURE;
-
-      return nullptr;
-    }
-  }
-
-  nsCOMPtr<nsIAtom> langGroup;
-  mCharSets->GetCharsetLangGroup(aCharSet, getter_AddRefs(langGroup));
-  if (!langGroup) {
-    if (aError)
-      *aError = NS_ERROR_FAILURE;
-
-    return nullptr;
-  }
-
-  if (aError)
-    *aError = NS_OK;
-
-  return langGroup.forget();
+  nsAutoCString group;
+  mozilla::dom::EncodingUtils::LangGroupForEncoding(aCharSet, group);
+  return do_GetAtom(group);
 }
 
 nsIAtom*
 nsLanguageAtomService::GetLocaleLanguage(nsresult *aError)
 {
   nsresult res = NS_OK;
 
   do {
--- a/intl/locale/src/nsLanguageAtomService.h
+++ b/intl/locale/src/nsLanguageAtomService.h
@@ -1,15 +1,14 @@
 /* -*- 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 "nsCOMPtr.h"
-#include "nsICharsetConverterManager.h"
 #include "nsILanguageAtomService.h"
 #include "nsIStringBundle.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIAtom.h"
 #include "mozilla/Attributes.h"
 
 #define NS_LANGUAGEATOMSERVICE_CID \
   {0xB7C65853, 0x2996, 0x435E, {0x96, 0x54, 0xDC, 0xC1, 0x78, 0xAA, 0xB4, 0x8C}}
@@ -19,28 +18,27 @@ class nsLanguageAtomService MOZ_FINAL : 
 public:
   NS_DECL_ISUPPORTS
 
   // nsILanguageAtomService
   virtual NS_HIDDEN_(nsIAtom*)
     LookupLanguage(const nsACString &aLanguage, nsresult *aError);
 
   virtual NS_HIDDEN_(already_AddRefed<nsIAtom>)
-    LookupCharSet(const char *aCharSet, nsresult *aError);
+    LookupCharSet(const nsACString& aCharSet);
 
   virtual NS_HIDDEN_(nsIAtom*) GetLocaleLanguage(nsresult *aError);
 
   virtual NS_HIDDEN_(nsIAtom*) GetLanguageGroup(nsIAtom *aLanguage,
                                                 nsresult *aError);
 
   nsLanguageAtomService() NS_HIDDEN;
 
 private:
   NS_HIDDEN ~nsLanguageAtomService() { }
 
 protected:
   NS_HIDDEN_(nsresult) InitLangGroupTable();
 
-  nsCOMPtr<nsICharsetConverterManager> mCharSets;
   nsInterfaceHashtable<nsISupportsHashKey, nsIAtom> mLangToGroup;
   nsCOMPtr<nsIStringBundle> mLangGroups;
   nsCOMPtr<nsIAtom> mLocaleLanguage;
 };
--- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
+++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
@@ -9,16 +9,19 @@
 #include "nsDateTimeFormatUnix.h"
 #include "nsIComponentManager.h"
 #include "nsILocaleService.h"
 #include "nsIPlatformCharset.h"
 #include "nsPosixLocale.h"
 #include "nsCRT.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 NS_IMPL_ISUPPORTS(nsDateTimeFormatUnix, nsIDateTimeFormat)
 
 // init this interface to a specified locale
 nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale)
 {
   nsAutoString localeStr;
   NS_NAMED_LITERAL_STRING(aCategory, "NSILOCALE_TIME##PLATFORM");
@@ -37,17 +40,17 @@ nsresult nsDateTimeFormatUnix::Initializ
       if (!mLocale.IsEmpty() &&
           mLocale.Equals(localeStr,
                          nsCaseInsensitiveStringComparator())) {
         return NS_OK;
       }
     }
   }
 
-  mCharset.AssignLiteral("ISO-8859-1");
+  mCharset.AssignLiteral("windows-1252");
   mPlatformLocale.Assign("en_US");
 
   // get locale name string, use app default if no locale specified
   if (!locale) {
     nsCOMPtr<nsILocaleService> localeService = 
              do_GetService(NS_LOCALESERVICE_CONTRACTID, &res);
     if (NS_SUCCEEDED(res)) {
       nsCOMPtr<nsILocale> appLocale;
@@ -76,22 +79,17 @@ nsresult nsDateTimeFormatUnix::Initializ
       nsAutoCString mappedCharset;
       res = platformCharset->GetDefaultCharsetForLocale(mLocale, mappedCharset);
       if (NS_SUCCEEDED(res)) {
         mCharset = mappedCharset;
       }
     }
   }
 
-  // Initialize unicode decoder
-  nsCOMPtr <nsICharsetConverterManager>  charsetConverterManager;
-  charsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res);
-  if (NS_SUCCEEDED(res)) {
-    res = charsetConverterManager->GetUnicodeDecoder(mCharset.get(), getter_AddRefs(mDecoder));
-  }
+  mDecoder = EncodingUtils::DecoderForEncoding(mCharset);
 
   LocalePreferred24hour();
 
   return res;
 }
 
 void nsDateTimeFormatUnix::LocalePreferred24hour()
 {
--- a/intl/locale/src/unix/nsDateTimeFormatUnix.h
+++ b/intl/locale/src/unix/nsDateTimeFormatUnix.h
@@ -3,19 +3,19 @@
  *
  * 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 nsDateTimeFormatUnix_h__
 #define nsDateTimeFormatUnix_h__
 
 
-#include "nsICharsetConverterManager.h"
 #include "nsCOMPtr.h"
 #include "nsIDateTimeFormat.h"
+#include "nsIUnicodeDecoder.h"
 
 #define kPlatformLocaleLength 64
 
 class nsDateTimeFormatUnix : public nsIDateTimeFormat {
 
 public: 
   NS_DECL_THREADSAFE_ISUPPORTS 
 
--- a/intl/locale/src/unix/nsUNIXCharset.cpp
+++ b/intl/locale/src/unix/nsUNIXCharset.cpp
@@ -6,35 +6,32 @@
 #include <locale.h>
 
 #include "mozilla/ArrayUtils.h"
 
 #include "nsIPlatformCharset.h"
 #include "nsUConvPropertySearch.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIUnicodeDecoder.h"
-#include "nsIUnicodeEncoder.h"
-#include "nsICharsetConverterManager.h"
 #include "nsEncoderDecoderUtils.h"
 #if HAVE_GNU_LIBC_VERSION_H
 #include <gnu/libc-version.h>
 #endif
 #ifdef HAVE_NL_TYPES_H
 #include <nl_types.h>
 #endif
 #if HAVE_LANGINFO_CODESET
 #include <langinfo.h>
 #endif
 #include "nsPlatformCharset.h"
 #include "prinit.h"
 #include "nsUnicharUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
 
+using mozilla::dom::EncodingUtils;
 using namespace mozilla;
 
 static const char* kUnixCharsets[][3] = {
 #include "unixcharset.properties.h"
 };
 
 NS_IMPL_ISUPPORTS(nsPlatformCharset, nsIPlatformCharset)
 
@@ -176,54 +173,16 @@ nsPlatformCharset::Init()
 nsresult
 nsPlatformCharset::VerifyCharset(nsCString &aCharset)
 {
   // fast path for UTF-8.  Most platform uses UTF-8 as charset now.
   if (aCharset.EqualsLiteral("UTF-8")) {
     return NS_OK;
   }
 
-  nsresult res;
-  //
-  // get the convert manager
-  //
-  nsCOMPtr <nsICharsetConverterManager>  charsetConverterManager;
-  charsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res);
-  if (NS_FAILED(res))
-    return res;
-
-  //
-  // check if we can get an input converter
-  //
-  nsCOMPtr <nsIUnicodeEncoder> enc;
-  res = charsetConverterManager->GetUnicodeEncoder(aCharset.get(), getter_AddRefs(enc));
-  if (NS_FAILED(res)) {
-    NS_ERROR("failed to create encoder");
-    return res;
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(aCharset, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
   }
 
-  //
-  // check if we can get an output converter
-  //
-  nsCOMPtr <nsIUnicodeDecoder> dec;
-  res = charsetConverterManager->GetUnicodeDecoder(aCharset.get(), getter_AddRefs(dec));
-  if (NS_FAILED(res)) {
-    NS_ERROR("failed to create decoder");
-    return res;
-  }
-
-  //
-  // check if we recognize the charset string
-  //
-
-  nsAutoCString result;
-  res = charsetConverterManager->GetCharsetAlias(aCharset.get(), result);
-  if (NS_FAILED(res)) {
-    return res;
-  }
-
-  //
-  // return the preferred string
-  //
-
-  aCharset.Assign(result);
+  aCharset.Assign(encoding);
   return NS_OK;
 }
--- a/intl/locale/src/unix/unixcharset.properties
+++ b/intl/locale/src/unix/unixcharset.properties
@@ -11,18 +11,16 @@
 ##   Put the general locale to charset mapping here.
 ##   If somehow two platform use the same locale name with different
 ##   charset, put the least common one in the platform specific section
 ##   This section have lower priority than the platform specific section
 ##
 ## The key is "locale.all." + locale name
 # AIX
 locale.all.ar_AA=ISO-8859-6
-# AIX
-locale.all.Ar_AA=x-IBM1046
 # Solaris
 locale.all.Ar_ARM=ISO-8859-6
 locale.all.american.iso88591=ISO-8859-1
 locale.all.bulgarian=ISO-8859-2
 locale.all.bg_BG.ISO8859-5=ISO-8859-5
 # AIX
 locale.all.bg_BG=ISO-8859-5
 locale.all.C=ISO-8859-1
@@ -111,18 +109,16 @@ locale.all.en_IE.ISO8859-15=ISO-8859-15
 locale.all.en_IE.ISO8859-15@euro=ISO-8859-15
 locale.all.en_JP=EUC-JP
 locale.all.en_JP.IBM-eucJP=EUC-JP
 locale.all.En_JP.IBM-932=Shift_JIS
 locale.all.En_JP=Shift_JIS
 locale.all.en_KR=EUC-KR
 locale.all.en_KR.IBM-eucKR=EUC-KR
 locale.all.en_TH=ISO-8859-1
-locale.all.en_TW=x-euc-tw
-locale.all.en_TW.IBM-eucTW=x-euc-tw
 locale.all.en_US=ISO-8859-1
 locale.all.en_US.88591=ISO-8859-1
 locale.all.en_US.ISO8859-1=ISO-8859-1
 #FreeBSD
 locale.all.en_US.ISO_8859-1=ISO-8859-1
 locale.all.da_DK.ISO_8859-1=ISO-8859-1
 locale.all.de_AT.ISO_8859-1=ISO-8859-1
 locale.all.de_CH.ISO_8859-1=ISO-8859-1
@@ -496,57 +492,45 @@ locale.all.sv_SE=ISO-8859-1
 locale.all.sv_SE.88591=ISO-8859-1
 locale.all.sv_SE.ISO8859-15=ISO-8859-15
 locale.all.sv_SE.ISO8859-15@euro=ISO-8859-15
 # HP
 locale.all.sv_SE.iso885915=ISO-8859-15
 # HP
 locale.all.sv_SE.iso885915@euro=ISO-8859-15
 locale.all.sv_SE.ISO8859-1=ISO-8859-1
-locale.all.Sv_SE=IBM-850
 # AIX
 locale.all.swedish.iso88591=ISO-8859-1
 # Solaris
 locale.all.tr_TR.ISO8859-9=ISO-8859-9
 # AIX
 locale.all.tr_TR=ISO-8859-9
 # Solaris
 locale.all.th_TH=TIS-620
 locale.all.th_TH.TIS620=TIS-620
 locale.all.th=TIS-620
 locale.all.th_TH.UTF-8=UTF-8
-locale.all.tchinese=x-euc-tw
 # RedHat 7 reported by Garaschenko Slava <slava@maze.ambernet.kiev.ua bug 70601
 locale.all.uk_UA=KOI8-U
 locale.all.zh=GB2312
 locale.all.zh_CN=GB2312
 locale.all.zh_CN.EUC=GB2312
 locale.all.zh.GBK=gbk
 locale.all.zh_CN.UTF-8=UTF-8
 locale.all.zh.UTF-8=UTF-8
-locale.all.zh_TW.EUC=x-euc-tw
 locale.all.zh_TW.BIG5=Big5
-locale.all.zh_HK.HKSCS=x-hkscs
 # saw the following name from news://xcin.linux.org.tw/tlug.cle-devel
 locale.all.zh_CN.GB2312=GB2312
 # AIX
 locale.all.ZH_CN=UTF-8
 locale.all.zh_CN.ugb=GB2312
 locale.all.zh_CN.GBK=gbk
 locale.all.zh_HK.big5=Big5
-locale.all.zh_HK.eucTW=x-euc-tw
-locale.all.zh_TW=x-euc-tw
-locale.all.zh_TW.IBM-eucTW=x-euc-tw
-locale.all.zh_TW.eucTW=x-euc-tw
-locale.all.zh_TW.eucTW@chuyin=x-euc-tw
-locale.all.zh_TW.eucTW@radical=x-euc-tw
-locale.all.zh_TW.eucTW@stroke=x-euc-tw
 locale.all.zh_TW.big5=Big5
 locale.all.zh_TW.big5@chuyin=Big5
 locale.all.zh_TW.big5@radical=Big5
 locale.all.zh_TW.big5@stroke=Big5
-locale.all.zh_TW.ucns=x-euc-tw
 # AIX
 locale.all.Zh_TW.big5=Big5
 # CLE 0.8
 locale.all.zh_TW.Big5=Big5
 # SunOS 5.7 according to pofeng@linux.org.tw (already above)
 # locale.all.zh_TW.BIG5=Big5
--- a/intl/locale/src/windows/wincharset.properties
+++ b/intl/locale/src/windows/wincharset.properties
@@ -1,17 +1,17 @@
 # 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/.
 #
 # This file map a ACP to a charset name
 # We use this to figure out the charset of file system, clipboard, etc
 #
 
-acp.874=TIS-620
+acp.874=windows-874
 acp.932=Shift_JIS
 acp.936=gb18030
 acp.949=EUC-KR
 acp.950=Big5
 acp.951=Big5-HKSCS
 acp.1250=windows-1250
 acp.1251=windows-1251
 acp.1252=windows-1252
--- a/intl/uconv/idl/moz.build
+++ b/intl/uconv/idl/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
-    'nsICharsetConverterManager.idl',
     'nsICurrentCharsetListener.idl',
     'nsIScriptableUConv.idl',
     'nsITextToSubURI.idl',
     'nsIUTF8ConverterService.idl',
 ]
 
 XPIDL_MODULE = 'uconv'
 
deleted file mode 100644
--- a/intl/uconv/idl/nsICharsetConverterManager.idl
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* 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 "nsISupports.idl"
-#include "nsIAtom.idl"
-
-%{ C++
-#include "nsIUnicodeDecoder.h"
-#include "nsIUnicodeEncoder.h"
-
-// XXX change to NS_CHARSETCONVERTERMANAGER_CID
-#define NS_ICHARSETCONVERTERMANAGER_CID \
-  {0x3c1c0163, 0x9bd0, 0x11d3, { 0x9d, 0x9, 0x0, 0x50, 0x4, 0x0, 0x7, 0xb2}}
-
-#define NS_CHARSETCONVERTERMANAGER_CONTRACTID "@mozilla.org/charset-converter-manager;1"
-%}
-
-interface nsIUnicodeDecoder;
-interface nsIUnicodeEncoder;
-interface nsIUTF8StringEnumerator;
-
-/**
- * DON'T ADD NEW USES OF THIS INTERFACE TO MOZILLA-CENTRAL. Use 
- * mozilla::dom::EncodingUtils instead.
- *
- * Here Charsets are identified by ASCII strings. Charset alias
- * resolution is provided by default in most methods. "Raw"
- * versions that do not need this resolution are also provided.
- *
- * @deprecated Use mozilla::dom::EncodingUtils in mozilla-central instead.
- * @created         21/Feb/2000
- * @author  Catalin Rotaru [CATA]
- */
-[scriptable, uuid(a0550d46-8d9c-47dd-acc7-c083620dff12)]
-interface nsICharsetConverterManager : nsISupports
-{
-    /**
-     * Get the Unicode decoder for the given charset.
-     * The "Raw" version skips charset alias resolution
-     */
-    [noscript] nsIUnicodeDecoder getUnicodeDecoder(in string charset);
-    [noscript] nsIUnicodeDecoder getUnicodeDecoderRaw(in string charset);
-    [noscript] nsIUnicodeDecoder getUnicodeDecoderInternal(in string charset);
-
-    /**
-     * Get the Unicode encoder for the given charset.
-     * The "Raw" version skips charset alias resolution
-     */
-    [noscript] nsIUnicodeEncoder getUnicodeEncoder(in string charset);
-    [noscript] nsIUnicodeEncoder getUnicodeEncoderRaw(in string charset);
-
-    /**
-     * A shortcut to calling nsICharsetAlias to do alias resolution
-     * @throws if aCharset is an unknown charset.
-     */
-    ACString getCharsetAlias(in string aCharset);
-    
-    /**
-     * Get the complete list of available decoders.
-     */
-    nsIUTF8StringEnumerator getDecoderList();
-
-    /**
-     * Get the complete list of available encoders.
-     */
-    nsIUTF8StringEnumerator getEncoderList();
-
-    /**
-     * Get the complete list of available charset detectors.
-     */
-    nsIUTF8StringEnumerator GetCharsetDetectorList();
-
-    /**
-     * Get the human-readable name for the given charset.
-     * @throws if aCharset is an unknown charset.
-     */
-    AString getCharsetTitle(in string aCharset);
-
-    /**
-     * Get some data about the given charset. This includes whether the 
-     * character encoding may be used for certain purposes, if it is 
-     * multi-byte, and the language code for it. See charsetData.properties
-     * for the source of this data. Some known property names:
-     *    notForBrowser  - not to be used in the browser.
-     *    notForOutgoing - not to be used for exporting files.
-     *    LangGroup      - language code for charset, e.g. 'he' and 'zh-CN'.
-     *    isMultibyte    - is this a multi-byte charset?
-     *    isInternal     - not to be used in untrusted web content.
-     * 
-     * @param aCharset name of the character encoding, e.g. 'iso-8859-15'.
-     * @param aProp property desired for the character encoding.
-     * @throws if aCharset is an unknown charset.
-     * @return the value of the property, for the character encoding.
-     */
-    AString getCharsetData(in string aCharset, 
-                           in wstring aProp);
-
-    /**
-     * Get the language group for the given charset. This is similar to 
-     * calling <tt>getCharsetData</tt> with the <tt>prop</tt> "LangGroup".
-     * 
-     * @param aCharset name of the character encoding, e.g. 'iso-8859-15'.
-     * @throws if aCharset is an unknown charset.
-     * @return the language code for the character encoding.
-     */
-    nsIAtom getCharsetLangGroup(in string aCharset);
-    nsIAtom getCharsetLangGroupRaw(in string aCharset);
-};
--- a/intl/uconv/idl/nsIScriptableUConv.idl
+++ b/intl/uconv/idl/nsIScriptableUConv.idl
@@ -68,14 +68,13 @@ interface nsIScriptableUnicodeConverter 
    * @throw NS_ERROR_UCONV_NOCONV
    *        The requested charset is not supported.
    */
   attribute string charset;
 
   /**
    * Internal use
    *
-   * When this attribute is set, all charsets may be accessed.
-   * When it is not set (the default), charsets with the isInternal flag
-   *  may not be accessed.
+   * When this attribute is set, all charsets may be accessed but only 
+   * by Gecko-canonical name.
    */
   attribute boolean isInternal;
 };
--- a/intl/uconv/public/nsEncoderDecoderUtils.h
+++ b/intl/uconv/public/nsEncoderDecoderUtils.h
@@ -4,19 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsEncoderDecoderUtils_h__
 #define nsEncoderDecoderUtils_h__
 
 #define NS_UNICODEDECODER_NAME "Charset Decoders"
 #define NS_UNICODEENCODER_NAME "Charset Encoders"
 
-#define NS_DATA_BUNDLE_CATEGORY     "uconv-charset-data"
-#define NS_TITLE_BUNDLE_CATEGORY    "uconv-charset-titles"
-
 #define NS_CONVERTER_REGISTRY_START \
   static const mozilla::Module::CategoryEntry kUConvCategories[] = {
 
 #define NS_CONVERTER_REGISTRY_END \
   { nullptr } \
   };
 
 #define NS_UCONV_REG_UNREG_DECODER(_Charset, _CID)          \
deleted file mode 100644
--- a/intl/uconv/src/charsetData.properties
+++ /dev/null
@@ -1,177 +0,0 @@
-# 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/.
-
-## Rule of this file:
-## 1. key should always be in lower case ascii so we can do case insensitive
-##    comparison in the code faster.
-
-## Format of this file:
-##
-## charset_name.notForOutgoing = anything  -  specifies that this charset is 
-## not to be used for exporting files ('SaveAsCharset' in composer)
-##
-## 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
-utf-7.isInternal                        = true
-t.61-8bit.isInternal                    = true
-ibm864.isInternal                       = true
-replacement.isInternal                  = true
-
-t.61-8bit.notForOutgoing                = true
-utf-7.notForOutgoing                    = true
-x-imap4-modified-utf7.notForOutgoing    = true
-us-ascii.notForOutgoing                 = true
-iso-8859-6-e.notForOutgoing             = true
-iso-8859-6-i.notForOutgoing             = true
-ibm864.notForOutgoing                   = true
-ibm869.notForOutgoing                   = true
-ibm1125.notForOutgoing                  = true
-ibm1131.notForOutgoing                  = true
-iso-8859-8-e.notForOutgoing             = true
-iso-8859-8.notForOutgoing               = true
-iso-2022-kr.notForOutgoing              = true
-x-johab.notForOutgoing                  = true
-replacement.notForOutgoing              = true
-
-# XXX : there are some entries only necessary for Gtk/Xlib builds
-# to map  XLFD registry-encoding pairs to langGroups. they can be
-# removed once bug 215537 is fixed.
-
-# 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)
-#      x-central-euro -> *-Latn-151 (Eastern Europe)
-#      x-baltic       -> *-Latn-154 (Northern Europe)
-#      x-cyrillic     -> *-Cyrl
-#      zh-TW          -> *-Hant-TW
-#      zh-HK          -> *-Hant-HK
-#      zh-CN          -> *-Hans
-#      ja             -> *-Jpan
-#      ko             -> *-Hang
-#      tr             -> *-Latn-TR
-#      he             -> *-Hebr
-#      ar             -> *-Arab
-# etc
-
-armscii-8.LangGroup                = x-armn
-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
-hz-gb-2312.LangGroup               = zh-CN
-ibm850.LangGroup                   = x-western
-ibm852.LangGroup                   = x-central-euro
-ibm855.LangGroup                   = x-cyrillic
-ibm857.LangGroup                   = tr
-ibm862.LangGroup                   = he
-ibm864.LangGroup                   = ar
-ibm866.LangGroup                   = x-cyrillic
-ibm869.LangGroup                   = el
-ibm1125.LangGroup                  = x-cyrillic
-ibm1131.LangGroup                  = x-cyrillic
-iso-2022-cn.LangGroup              = zh-CN
-iso-2022-jp.LangGroup              = ja
-iso-2022-kr.LangGroup              = ko
-iso-8859-1.LangGroup               = x-western
-iso-8859-10.LangGroup              = x-western
-iso-8859-14.LangGroup              = x-western
-iso-8859-15.LangGroup              = x-western
-iso-8859-2.LangGroup               = x-central-euro
-iso-8859-16.LangGroup              = x-central-euro
-iso-8859-3.LangGroup               = x-western
-iso-8859-4.LangGroup               = x-baltic
-iso-8859-13.LangGroup              = x-baltic
-iso-8859-5.LangGroup               = x-cyrillic
-iso-8859-6.LangGroup               = ar
-iso-8859-6-e.LangGroup             = ar
-iso-8859-6-i.LangGroup             = ar
-iso-8859-7.LangGroup               = el
-iso-8859-8.LangGroup               = he
-iso-8859-8-e.LangGroup             = he
-iso-8859-8-i.LangGroup             = he
-iso-8859-9.LangGroup               = tr
-jis_0208-1983.LangGroup            = ja
-koi8-r.LangGroup                   = x-cyrillic
-koi8-u.LangGroup                   = x-cyrillic
-iso-ir-111.LangGroup               = x-cyrillic
-shift_jis.LangGroup                = ja
-tis-620.LangGroup                  = th
-tis620-2.LangGroup                 = th
-windows-874.LangGroup              = th
-iso-8859-11.LangGroup              = th
-us-ascii.LangGroup                 = x-western
-t.61-8bit.LangGroup                = x-western
-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
-viscii.LangGroup                   = x-western
-x-viet-tcvn5712.LangGroup          = x-western
-x-viet-vps.LangGroup               = x-western
-windows-1250.LangGroup             = x-central-euro
-windows-1251.LangGroup             = x-cyrillic
-windows-1252.LangGroup             = x-western
-windows-1253.LangGroup             = el
-windows-1254.LangGroup             = tr
-windows-1255.LangGroup             = he
-windows-1256.LangGroup             = ar
-windows-1257.LangGroup             = x-baltic
-windows-1258.LangGroup             = x-western
-x-euc-tw.LangGroup                 = zh-TW
-gbk.LangGroup                      = zh-CN
-gb_2312-80.LangGroup               = zh-CN
-x-mac-ce.LangGroup                 = x-central-euro
-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
-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-unicode
-ks_c_5601-1987.LangGroup           = ko
-x-johab.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
-x-euc-tw.isMultibyte        = true
-gb2312.isMultibyte          = true
-hz-gb-2312.isMultibyte      = true
-iso-2022-kr.isMultibyte     = true
-euc-kr.isMultibyte          = true
-x-johab.isMultibyte         = true
-utf-7.isMultibyte           = true
-utf-8.isMultibyte           = true
-replacement.isMultibyte     = true
deleted file mode 100644
--- a/intl/uconv/src/jar.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-# 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/.
-
-toolkit.jar:
-        res/charsetData.properties     (charsetData.properties)
--- a/intl/uconv/src/moz.build
+++ b/intl/uconv/src/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 UNIFIED_SOURCES += [
-    'nsCharsetConverterManager.cpp',
     'nsConverterInputStream.cpp',
     'nsConverterOutputStream.cpp',
     'nsCP1252ToUnicode.cpp',
     'nsISO88591ToUnicode.cpp',
     'nsMacRomanToUnicode.cpp',
     'nsReplacementToUnicode.cpp',
     'nsScriptableUConv.cpp',
     'nsTextToSubURI.cpp',
@@ -210,9 +209,8 @@ LOCAL_INCLUDES += [
     '../ucvlatin',
     '../ucvtw',
     '../ucvtw2',
     '../util',
 ]
 
 FINAL_LIBRARY = 'xul'
 
-JAR_MANIFESTS += ['jar.mn']
deleted file mode 100644
--- a/intl/uconv/src/nsCharsetConverterManager.cpp
+++ /dev/null
@@ -1,356 +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 "nsCOMPtr.h"
-#include "nsString.h"
-#include "nsUnicharUtils.h"
-#include "nsCharsetAlias.h"
-#include "nsICategoryManager.h"
-#include "nsICharsetConverterManager.h"
-#include "nsEncoderDecoderUtils.h"
-#include "nsIStringBundle.h"
-#include "nsTArray.h"
-#include "nsStringEnumerator.h"
-#include "mozilla/Services.h"
-
-#include "nsComponentManagerUtils.h"
-#include "nsISupportsPrimitives.h"
-#include "nsServiceManagerUtils.h"
-
-// just for CONTRACTIDs
-#include "nsCharsetConverterManager.h"
-
-static nsIStringBundle * sDataBundle;
-static nsIStringBundle * sTitleBundle;
-
-// Class nsCharsetConverterManager [implementation]
-
-NS_IMPL_ISUPPORTS(nsCharsetConverterManager, nsICharsetConverterManager)
-
-nsCharsetConverterManager::nsCharsetConverterManager() 
-{
-}
-
-nsCharsetConverterManager::~nsCharsetConverterManager() 
-{
-}
-
-//static
-void nsCharsetConverterManager::Shutdown()
-{
-  NS_IF_RELEASE(sDataBundle);
-  NS_IF_RELEASE(sTitleBundle);
-}
-
-static
-nsresult LoadExtensibleBundle(const char* aCategory, 
-                              nsIStringBundle ** aResult)
-{
-  nsCOMPtr<nsIStringBundleService> sbServ =
-    mozilla::services::GetStringBundleService();
-  if (!sbServ)
-    return NS_ERROR_FAILURE;
-
-  return sbServ->CreateExtensibleBundle(aCategory, aResult);
-}
-
-static
-nsresult GetBundleValue(nsIStringBundle * aBundle, 
-                        const char * aName, 
-                        const nsAFlatString& aProp, 
-                        char16_t ** aResult)
-{
-  nsAutoString key; 
-
-  key.AssignWithConversion(aName);
-  ToLowerCase(key); // we lowercase the main comparison key
-  key.Append(aProp);
-
-  return aBundle->GetStringFromName(key.get(), aResult);
-}
-
-static
-nsresult GetBundleValue(nsIStringBundle * aBundle, 
-                        const char * aName, 
-                        const nsAFlatString& aProp, 
-                        nsAString& aResult)
-{
-  nsresult rv = NS_OK;
-
-  nsXPIDLString value;
-  rv = GetBundleValue(aBundle, aName, aProp, getter_Copies(value));
-  if (NS_FAILED(rv))
-    return rv;
-
-  aResult = value;
-
-  return NS_OK;
-}
-
-static
-nsresult GetCharsetDataImpl(const char * aCharset, const char16_t * aProp,
-                            nsAString& aResult)
-{
-  NS_ENSURE_ARG_POINTER(aCharset);
-  // aProp can be nullptr
-
-  if (!sDataBundle) {
-    nsresult rv = LoadExtensibleBundle(NS_DATA_BUNDLE_CATEGORY, &sDataBundle);
-    if (NS_FAILED(rv))
-      return rv;
-  }
-
-  return GetBundleValue(sDataBundle, aCharset, nsDependentString(aProp), aResult);
-}
-
-//static
-bool nsCharsetConverterManager::IsInternal(const nsACString& aCharset)
-{
-  nsAutoString str;
-  // fully qualify to possibly avoid vtable call
-  nsresult rv = GetCharsetDataImpl(PromiseFlatCString(aCharset).get(),
-                                   MOZ_UTF16(".isInternal"),
-                                   str);
-
-  return NS_SUCCEEDED(rv);
-}
-
-
-//----------------------------------------------------------------------------//----------------------------------------------------------------------------
-// Interface nsICharsetConverterManager [implementation]
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetUnicodeEncoder(const char * aDest, 
-                                             nsIUnicodeEncoder ** aResult)
-{
-  // resolve the charset first
-  nsAutoCString charset;
-  
-  // fully qualify to possibly avoid vtable call
-  nsCharsetConverterManager::GetCharsetAlias(aDest, charset);
-
-  return nsCharsetConverterManager::GetUnicodeEncoderRaw(charset.get(),
-                                                         aResult);
-}
-
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetUnicodeEncoderRaw(const char * aDest, 
-                                                nsIUnicodeEncoder ** aResult)
-{
-  *aResult= nullptr;
-  nsCOMPtr<nsIUnicodeEncoder> encoder;
-
-  nsresult rv = NS_OK;
-
-  nsAutoCString
-    contractid(NS_LITERAL_CSTRING(NS_UNICODEENCODER_CONTRACTID_BASE) +
-               nsDependentCString(aDest));
-
-  // Always create an instance since encoders hold state.
-  encoder = do_CreateInstance(contractid.get(), &rv);
-
-  if (NS_FAILED(rv))
-    rv = NS_ERROR_UCONV_NOCONV;
-  else
-  {
-    *aResult = encoder.get();
-    NS_ADDREF(*aResult);
-  }
-  return rv;
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetUnicodeDecoder(const char * aSrc, 
-                                             nsIUnicodeDecoder ** aResult)
-{
-  // resolve the charset first
-  nsAutoCString charset;
-
-  // fully qualify to possibly avoid vtable call
-  if (NS_FAILED(nsCharsetConverterManager::GetCharsetAlias(aSrc, charset)))
-    return NS_ERROR_UCONV_NOCONV;
-
-  return nsCharsetConverterManager::GetUnicodeDecoderRaw(charset.get(),
-                                                         aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetUnicodeDecoderInternal(const char * aSrc, 
-                                                     nsIUnicodeDecoder ** aResult)
-{
-  // resolve the charset first
-  nsAutoCString charset;
-
-  nsresult rv = nsCharsetAlias::GetPreferredInternal(nsDependentCString(aSrc),
-                                                     charset);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return nsCharsetConverterManager::GetUnicodeDecoderRaw(charset.get(),
-                                                         aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetUnicodeDecoderRaw(const char * aSrc, 
-                                                nsIUnicodeDecoder ** aResult)
-{
-  *aResult= nullptr;
-  nsCOMPtr<nsIUnicodeDecoder> decoder;
-
-  nsresult rv = NS_OK;
-
-  NS_NAMED_LITERAL_CSTRING(contractbase, NS_UNICODEDECODER_CONTRACTID_BASE);
-  nsDependentCString src(aSrc);
-
-  decoder = do_CreateInstance(PromiseFlatCString(contractbase + src).get(),
-                              &rv);
-  NS_ENSURE_SUCCESS(rv, NS_ERROR_UCONV_NOCONV);
-
-  decoder.forget(aResult);
-  return rv;
-}
-
-static
-nsresult GetList(const nsACString& aCategory,
-                 const nsACString& aPrefix,
-                 nsIUTF8StringEnumerator** aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-  *aResult = nullptr;
-
-  nsresult rv;
-
-  nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
-  if (NS_FAILED(rv))
-    return rv;
-
-  nsTArray<nsCString>* array = new nsTArray<nsCString>;
-  if (!array)
-    return NS_ERROR_OUT_OF_MEMORY;
-  
-  nsCOMPtr<nsISimpleEnumerator> enumerator;
-  catman->EnumerateCategory(PromiseFlatCString(aCategory).get(), 
-                            getter_AddRefs(enumerator));
-
-  bool hasMore;
-  while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) {
-    nsCOMPtr<nsISupports> supports;
-    if (NS_FAILED(enumerator->GetNext(getter_AddRefs(supports))))
-      continue;
-    
-    nsCOMPtr<nsISupportsCString> supStr = do_QueryInterface(supports);
-    if (!supStr)
-      continue;
-
-    nsAutoCString name;
-    if (NS_FAILED(supStr->GetData(name)))
-      continue;
-
-    nsAutoCString fullName(aPrefix);
-    fullName.Append(name);
-    NS_ENSURE_TRUE(array->AppendElement(fullName), NS_ERROR_OUT_OF_MEMORY);
-  }
-    
-  return NS_NewAdoptingUTF8StringEnumerator(aResult, array);
-}
-
-// we should change the interface so that we can just pass back a enumerator!
-NS_IMETHODIMP
-nsCharsetConverterManager::GetDecoderList(nsIUTF8StringEnumerator ** aResult)
-{
-  return GetList(NS_LITERAL_CSTRING(NS_UNICODEDECODER_NAME),
-                 EmptyCString(), aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetEncoderList(nsIUTF8StringEnumerator ** aResult)
-{
-  return GetList(NS_LITERAL_CSTRING(NS_UNICODEENCODER_NAME),
-                 EmptyCString(), aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetCharsetDetectorList(nsIUTF8StringEnumerator** aResult)
-{
-  return GetList(NS_LITERAL_CSTRING("charset-detectors"),
-                 NS_LITERAL_CSTRING("chardet."), aResult);
-}
-
-// XXX Improve the implementation of this method. Right now, it is build on 
-// top of the nsCharsetAlias service. We can make the nsCharsetAlias
-// better, with its own hash table (not the StringBundle anymore) and
-// a nicer file format.
-NS_IMETHODIMP
-nsCharsetConverterManager::GetCharsetAlias(const char * aCharset, 
-                                           nsACString& aResult)
-{
-  NS_ENSURE_ARG_POINTER(aCharset);
-
-  // We try to obtain the preferred name for this charset from the charset 
-  // aliases.
-  nsresult rv;
-
-  rv = nsCharsetAlias::GetPreferred(nsDependentCString(aCharset), aResult);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetCharsetTitle(const char * aCharset, 
-                                           nsAString& aResult)
-{
-  NS_ENSURE_ARG_POINTER(aCharset);
-
-  if (!sTitleBundle) {
-    nsresult rv = LoadExtensibleBundle(NS_TITLE_BUNDLE_CATEGORY, &sTitleBundle);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  return GetBundleValue(sTitleBundle, aCharset, NS_LITERAL_STRING(".title"), aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetCharsetData(const char * aCharset, 
-                                          const char16_t * aProp,
-                                          nsAString& aResult)
-{
-  return GetCharsetDataImpl(aCharset, aProp, aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetCharsetLangGroup(const char * aCharset, 
-                                               nsIAtom** aResult)
-{
-  // resolve the charset first
-  nsAutoCString charset;
-
-  nsresult rv = GetCharsetAlias(aCharset, charset);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // fully qualify to possibly avoid vtable call
-  return nsCharsetConverterManager::GetCharsetLangGroupRaw(charset.get(),
-                                                           aResult);
-}
-
-NS_IMETHODIMP
-nsCharsetConverterManager::GetCharsetLangGroupRaw(const char * aCharset, 
-                                                  nsIAtom** aResult)
-{
-
-  *aResult = nullptr;
-  nsAutoString langGroup;
-  // fully qualify to possibly avoid vtable call
-  nsresult rv = nsCharsetConverterManager::GetCharsetData(
-      aCharset, MOZ_UTF16(".LangGroup"), langGroup);
-
-  if (NS_SUCCEEDED(rv)) {
-    ToLowerCase(langGroup); // use lowercase for all language atoms
-    *aResult = NS_NewAtom(langGroup).take();
-  }
-
-  return rv;
-}
deleted file mode 100644
--- a/intl/uconv/src/nsCharsetConverterManager.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C; tab-width: 4; 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 nsCharsetConverterManager_h__
-#define nsCharsetConverterManager_h__
-
-#include "nsISupports.h"
-#include "nsICharsetConverterManager.h"
-
-class nsCharsetAlias;
-
-class nsCharsetConverterManager : public nsICharsetConverterManager
-{
-  friend class nsCharsetAlias;
-
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSICHARSETCONVERTERMANAGER
-
-public:
-  nsCharsetConverterManager();
-  virtual ~nsCharsetConverterManager();
-
-  static void Shutdown();
-
-private:
-
-  static bool IsInternal(const nsACString& aCharset);
-};
-
-#endif // nsCharsetConverterManager_h__
-
-
--- a/intl/uconv/src/nsConverterInputStream.cpp
+++ b/intl/uconv/src/nsConverterInputStream.cpp
@@ -1,49 +1,53 @@
 /* -*- Mode: C; tab-width: 4; 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 "nsConverterInputStream.h"
 #include "nsIInputStream.h"
-#include "nsICharsetConverterManager.h"
 #include "nsReadLine.h"
 #include "nsStreamUtils.h"
-#include "nsServiceManagerUtils.h"
 #include <algorithm>
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 #define CONVERTER_BUFFER_SIZE 8192
 
 NS_IMPL_ISUPPORTS(nsConverterInputStream, nsIConverterInputStream,
                   nsIUnicharInputStream, nsIUnicharLineInputStream)
 
 
 NS_IMETHODIMP
 nsConverterInputStream::Init(nsIInputStream* aStream,
                              const char *aCharset,
                              int32_t aBufferSize,
                              char16_t aReplacementChar)
 {
-    static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
-
-    if (!aCharset)
-        aCharset = "UTF-8";
-
-    nsresult rv;
+    nsAutoCString label;
+    if (!aCharset) {
+        label.AssignLiteral("UTF-8");
+    } else {
+        label = aCharset;
+    }
 
     if (aBufferSize <=0) aBufferSize=CONVERTER_BUFFER_SIZE;
     
     // get the decoder
-    nsCOMPtr<nsICharsetConverterManager> ccm =
-        do_GetService(kCharsetConverterManagerCID, &rv);
-    if (NS_FAILED(rv)) return rv;
-
-    rv = ccm->GetUnicodeDecoder(aCharset ? aCharset : "ISO-8859-1", getter_AddRefs(mConverter));
-    if (NS_FAILED(rv)) return rv;
+    nsAutoCString encoding;
+    if (label.EqualsLiteral("UTF-16")) {
+        // Compat with old test cases. Unclear if any extensions really care.
+        encoding.Assign(label);
+    } else if (!EncodingUtils::FindEncodingForLabelNoReplacement(label,
+                                                                 encoding)) {
+      return NS_ERROR_UCONV_NOCONV;
+    }
+    mConverter = EncodingUtils::DecoderForEncoding(encoding);
  
     // set up our buffers
     if (!mByteData.SetCapacity(aBufferSize) ||
         !mUnicharData.SetCapacity(aBufferSize)) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     mInput = aStream;
--- a/intl/uconv/src/nsConverterOutputStream.cpp
+++ b/intl/uconv/src/nsConverterOutputStream.cpp
@@ -1,20 +1,23 @@
 /* vim:set expandtab ts=4 sw=4 sts=4 cin: */
 /* 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 "nsCOMPtr.h"
 
 #include "nsIOutputStream.h"
-#include "nsICharsetConverterManager.h"
+#include "nsString.h"
 
 #include "nsConverterOutputStream.h"
-#include "nsServiceManagerUtils.h"
+#include "nsIUnicodeEncoder.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 NS_IMPL_ISUPPORTS(nsConverterOutputStream,
                   nsIUnicharOutputStream,
                   nsIConverterOutputStream)
 
 nsConverterOutputStream::~nsConverterOutputStream()
 {
     Close();
@@ -23,27 +26,32 @@ nsConverterOutputStream::~nsConverterOut
 NS_IMETHODIMP
 nsConverterOutputStream::Init(nsIOutputStream* aOutStream,
                               const char*      aCharset,
                               uint32_t         aBufferSize /* ignored */,
                               char16_t        aReplacementChar)
 {
     NS_PRECONDITION(aOutStream, "Null output stream!");
 
-    if (!aCharset)
-        aCharset = "UTF-8";
+    nsAutoCString label;
+    if (!aCharset) {
+        label.AssignLiteral("UTF-8");
+    } else {
+        label = aCharset;
+    }
 
-    nsresult rv;
-    nsCOMPtr<nsICharsetConverterManager> ccm =
-        do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-
-    rv = ccm->GetUnicodeEncoder(aCharset, getter_AddRefs(mConverter));
-    if (NS_FAILED(rv))
-        return rv;
+    nsAutoCString encoding;
+    if (label.EqualsLiteral("UTF-16")) {
+        // Make sure to output a BOM when UTF-16 requested
+        encoding.Assign(label);
+    } else if (!EncodingUtils::FindEncodingForLabelNoReplacement(label,
+                                                                 encoding)) {
+      return NS_ERROR_UCONV_NOCONV;
+    }
+    mConverter = EncodingUtils::EncoderForEncoding(encoding);
 
     mOutStream = aOutStream;
 
     int32_t behaviour = aReplacementChar ? nsIUnicodeEncoder::kOnError_Replace
                                          : nsIUnicodeEncoder::kOnError_Signal;
     return mConverter->
         SetOutputErrorBehavior(behaviour,
                                nullptr,
--- a/intl/uconv/src/nsScriptableUConv.cpp
+++ b/intl/uconv/src/nsScriptableUConv.cpp
@@ -1,21 +1,23 @@
 /* -*- 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 "nsString.h"
-#include "nsICharsetConverterManager.h"
 #include "nsIScriptableUConv.h"
 #include "nsScriptableUConv.h"
 #include "nsIStringStream.h"
 #include "nsComponentManagerUtils.h"
-#include "nsCharsetAlias.h"
-#include "nsServiceManagerUtils.h"
+#include "nsIUnicodeDecoder.h"
+#include "nsIUnicodeEncoder.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 /* Implementation file */
 NS_IMPL_ISUPPORTS(nsScriptableUnicodeConverter, nsIScriptableUnicodeConverter)
 
 nsScriptableUnicodeConverter::nsScriptableUnicodeConverter()
 : mIsInternal(false)
 {
 }
@@ -248,49 +250,42 @@ nsScriptableUnicodeConverter::SetIsInter
 {
   mIsInternal = aIsInternal;
   return NS_OK;
 }
 
 nsresult
 nsScriptableUnicodeConverter::InitConverter()
 {
-  nsresult rv = NS_OK;
   mEncoder = nullptr;
 
-  nsCOMPtr<nsICharsetConverterManager> ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  if (NS_FAILED(rv) || !ccm) {
-    return rv;
-  }
-
-  // get an unicode converter
-  rv = ccm->GetUnicodeEncoder(mCharset.get(), getter_AddRefs(mEncoder));
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  rv = mEncoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nullptr, (char16_t)'?');
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  nsAutoCString charset;
-  rv = mIsInternal ? nsCharsetAlias::GetPreferredInternal(mCharset, charset)
-                   : nsCharsetAlias::GetPreferred(mCharset, charset);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  rv = ccm->GetUnicodeDecoderRaw(charset.get(), getter_AddRefs(mDecoder));
-  if (NS_FAILED(rv)) {
-    return rv;
+  nsAutoCString encoding;
+  if (mIsInternal) {
+    encoding.Assign(mCharset);
+    // Better have a valid encoding name at this point! Otherwise, we'll
+    // crash with MOZ_ASSERT in debug builds. However, since this code
+    // might be called by severely misguided extensions in opt builds, the
+    // error condition is tested for below.
+    mEncoder = EncodingUtils::EncoderForEncoding(mCharset);
+    mDecoder = EncodingUtils::DecoderForEncoding(mCharset);
+    if (!mEncoder || !mDecoder) {
+      return NS_ERROR_UCONV_NOCONV;
+    }
+  } else {
+    if (!EncodingUtils::FindEncodingForLabelNoReplacement(mCharset, encoding)) {
+      return NS_ERROR_UCONV_NOCONV;
+    }
+    mEncoder = EncodingUtils::EncoderForEncoding(encoding);
+    mDecoder = EncodingUtils::DecoderForEncoding(encoding);
   }
 
   // The UTF-8 decoder used to throw regardless of the error behavior.
   // Simulating the old behavior for compatibility with legacy callers
   // (including addons). If callers want a control over the behavior,
   // they should switch to TextDecoder.
-  if (charset.EqualsLiteral("UTF-8")) {
+  if (encoding.EqualsLiteral("UTF-8")) {
     mDecoder->SetInputErrorBehavior(nsIUnicodeDecoder::kOnError_Signal);
   }
 
-  return rv ;
+  return mEncoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace,
+                                          nullptr,
+                                          (char16_t)'?');
 }
--- a/intl/uconv/src/nsScriptableUConv.h
+++ b/intl/uconv/src/nsScriptableUConv.h
@@ -3,16 +3,19 @@
  * 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 __nsScriptableUConv_h_
 #define __nsScriptableUConv_h_
 
 #include "nsIScriptableUConv.h"
+#include "nsCOMPtr.h"
+#include "nsIUnicodeDecoder.h"
+#include "nsIUnicodeEncoder.h"
 
 class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISCRIPTABLEUNICODECONVERTER
 
   nsScriptableUnicodeConverter();
--- a/intl/uconv/src/nsTextToSubURI.cpp
+++ b/intl/uconv/src/nsTextToSubURI.cpp
@@ -1,83 +1,85 @@
 /* -*- Mode: C++; tab-width: 4; 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 "nsString.h"
 #include "nsIUnicodeEncoder.h"
-#include "nsICharsetConverterManager.h"
+#include "nsIUnicodeDecoder.h"
 #include "nsITextToSubURI.h"
 #include "nsEscape.h"
 #include "nsTextToSubURI.h"
 #include "nsCRT.h"
-#include "nsServiceManagerUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
 
-static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
+using mozilla::dom::EncodingUtils;
 
 nsTextToSubURI::nsTextToSubURI()
 {
 }
 nsTextToSubURI::~nsTextToSubURI()
 {
 }
 
 NS_IMPL_ISUPPORTS(nsTextToSubURI, nsITextToSubURI)
 
 NS_IMETHODIMP  nsTextToSubURI::ConvertAndEscape(
   const char *charset, const char16_t *text, char **_retval) 
 {
-  if(nullptr == _retval)
+  if (!_retval) {
     return NS_ERROR_NULL_POINTER;
+  }
   *_retval = nullptr;
   nsresult rv = NS_OK;
   
-  // Get Charset, get the encoder.
-  nsICharsetConverterManager *ccm;
-  rv = CallGetService(kCharsetConverterManagerCID, &ccm);
-  if(NS_SUCCEEDED(rv)) {
-     nsIUnicodeEncoder *encoder;
-     rv = ccm->GetUnicodeEncoder(charset, &encoder);
-     NS_RELEASE(ccm);
-     if (NS_SUCCEEDED(rv)) {
-       rv = encoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nullptr, (char16_t)'?');
-       if(NS_SUCCEEDED(rv))
-       {
-          char buf[256];
-          char *pBuf = buf;
-          int32_t ulen = text ? NS_strlen(text) : 0;
-          int32_t outlen = 0;
-          if(NS_SUCCEEDED(rv = encoder->GetMaxLength(text, ulen, &outlen))) 
-          {
-             if(outlen >= 256) {
-                pBuf = (char*)NS_Alloc(outlen+1);
-             }
-             if(nullptr == pBuf) {
-                outlen = 255;
-                pBuf = buf;
-             }
-             int32_t bufLen = outlen;
-             if(NS_SUCCEEDED(rv = encoder->Convert(text,&ulen, pBuf, &outlen))) {
-                // put termination characters (e.g. ESC(B of ISO-2022-JP) if necessary
-                int32_t finLen = bufLen - outlen;
-                if (finLen > 0) {
-                  if (NS_SUCCEEDED(encoder->Finish((char *)(pBuf+outlen), &finLen)))
-                    outlen += finLen;
-                }
-                pBuf[outlen] = '\0';
-                *_retval = nsEscape(pBuf, url_XPAlphas);
-                if(nullptr == *_retval)
-                  rv = NS_ERROR_OUT_OF_MEMORY;
-             }
+  if (!charset) {
+    return NS_ERROR_NULL_POINTER;
+  }
+
+  nsDependentCString label(charset);
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
+  }
+  nsCOMPtr<nsIUnicodeEncoder> encoder =
+    EncodingUtils::EncoderForEncoding(encoding);
+  rv = encoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nullptr, (char16_t)'?');
+  if (NS_SUCCEEDED(rv) ) {
+    char buf[256];
+    char *pBuf = buf;
+    int32_t ulen = text ? NS_strlen(text) : 0;
+    int32_t outlen = 0;
+    if (NS_SUCCEEDED(rv = encoder->GetMaxLength(text, ulen, &outlen))) {
+      if (outlen >= 256) {
+        pBuf = (char*)NS_Alloc(outlen+1);
+      }
+      if (nullptr == pBuf) {
+        outlen = 255;
+        pBuf = buf;
+      }
+      int32_t bufLen = outlen;
+      if (NS_SUCCEEDED(rv = encoder->Convert(text,&ulen, pBuf, &outlen))) {
+        // put termination characters (e.g. ESC(B of ISO-2022-JP) if necessary
+        int32_t finLen = bufLen - outlen;
+        if (finLen > 0) {
+          if (NS_SUCCEEDED(encoder->Finish((char *)(pBuf+outlen), &finLen))) {
+            outlen += finLen;
           }
-          if(pBuf != buf)
-             NS_Free(pBuf);
-       }
-       NS_RELEASE(encoder);
-     }
+        }
+        pBuf[outlen] = '\0';
+        *_retval = nsEscape(pBuf, url_XPAlphas);
+        if (nullptr == *_retval) {
+          rv = NS_ERROR_OUT_OF_MEMORY;
+        }
+      }
+    }
+    if (pBuf != buf) {
+      NS_Free(pBuf);
+    }
   }
   
   return rv;
 }
 
 NS_IMETHODIMP  nsTextToSubURI::UnEscapeAndConvert(
   const char *charset, const char *text, char16_t **_retval) 
 {
@@ -86,47 +88,49 @@ NS_IMETHODIMP  nsTextToSubURI::UnEscapeA
   if(nullptr == text) {
     // set empty string instead of returning error
     // due to compatibility for old version
     text = "";
   }
   *_retval = nullptr;
   nsresult rv = NS_OK;
   
+  if (!charset) {
+    return NS_ERROR_NULL_POINTER;
+  }
+
+
   // unescape the string, unescape changes the input
   char *unescaped = NS_strdup(text);
   if (nullptr == unescaped)
     return NS_ERROR_OUT_OF_MEMORY;
   unescaped = nsUnescape(unescaped);
   NS_ASSERTION(unescaped, "nsUnescape returned null");
 
-  // Convert from the charset to unicode
-  nsCOMPtr<nsICharsetConverterManager> ccm = 
-           do_GetService(kCharsetConverterManagerCID, &rv); 
-  if (NS_SUCCEEDED(rv)) {
-    nsIUnicodeDecoder *decoder;
-    rv = ccm->GetUnicodeDecoder(charset, &decoder);
-    if (NS_SUCCEEDED(rv)) {
-      char16_t *pBuf = nullptr;
-      int32_t len = strlen(unescaped);
-      int32_t outlen = 0;
-      if (NS_SUCCEEDED(rv = decoder->GetMaxLength(unescaped, len, &outlen))) {
-        pBuf = (char16_t *) NS_Alloc((outlen+1)*sizeof(char16_t));
-        if (nullptr == pBuf)
-          rv = NS_ERROR_OUT_OF_MEMORY;
-        else {
-          if (NS_SUCCEEDED(rv = decoder->Convert(unescaped, &len, pBuf, &outlen))) {
-            pBuf[outlen] = 0;
-            *_retval = pBuf;
-          }
-          else
-            NS_Free(pBuf);
-        }
+  nsDependentCString label(charset);
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
+  }
+  nsCOMPtr<nsIUnicodeDecoder> decoder =
+    EncodingUtils::DecoderForEncoding(encoding);
+  char16_t *pBuf = nullptr;
+  int32_t len = strlen(unescaped);
+  int32_t outlen = 0;
+  if (NS_SUCCEEDED(rv = decoder->GetMaxLength(unescaped, len, &outlen))) {
+    pBuf = (char16_t *) NS_Alloc((outlen+1)*sizeof(char16_t));
+    if (nullptr == pBuf) {
+      rv = NS_ERROR_OUT_OF_MEMORY;
+    } else {
+      if (NS_SUCCEEDED(rv = decoder->Convert(unescaped, &len, pBuf, &outlen))) {
+        pBuf[outlen] = 0;
+        *_retval = pBuf;
+      } else {
+        NS_Free(pBuf);
       }
-      NS_RELEASE(decoder);
     }
   }
   NS_Free(unescaped);
 
   return rv;
 }
 
 static bool statefulCharset(const char *charset)
@@ -159,24 +163,23 @@ nsresult nsTextToSubURI::convertURItoUni
       CopyUTF8toUTF16(aURI, _retval);
       return rv;
     }
   }
 
   // empty charset could indicate UTF-8, but aURI turns out not to be UTF-8.
   NS_ENSURE_FALSE(aCharset.IsEmpty(), NS_ERROR_INVALID_ARG);
 
-  nsCOMPtr<nsICharsetConverterManager> charsetConverterManager;
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(aCharset, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
+  }
+  nsCOMPtr<nsIUnicodeDecoder> unicodeDecoder =
+    EncodingUtils::DecoderForEncoding(encoding);
 
-  charsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIUnicodeDecoder> unicodeDecoder;
-  rv = charsetConverterManager->GetUnicodeDecoder(aCharset.get(), 
-                                                  getter_AddRefs(unicodeDecoder));
   NS_ENSURE_SUCCESS(rv, rv);
   unicodeDecoder->SetInputErrorBehavior(nsIUnicodeDecoder::kOnError_Signal);
 
   int32_t srcLen = aURI.Length();
   int32_t dstLen;
   rv = unicodeDecoder->GetMaxLength(aURI.get(), srcLen, &dstLen);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/intl/uconv/src/nsTextToSubURI.h
+++ b/intl/uconv/src/nsTextToSubURI.h
@@ -1,16 +1,17 @@
 /* -*- Mode: C; tab-width: 4; 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 nsTextToSubURI_h__
 #define nsTextToSubURI_h__
 
 #include "nsITextToSubURI.h"
+#include "nsString.h"
 
 //==============================================================
 class nsTextToSubURI: public nsITextToSubURI {
   NS_DECL_ISUPPORTS
   NS_DECL_NSITEXTTOSUBURI
 
 public:
   nsTextToSubURI();
--- a/intl/uconv/src/nsUConvModule.cpp
+++ b/intl/uconv/src/nsUConvModule.cpp
@@ -1,20 +1,18 @@
 /* -*- 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 "mozilla/ModuleUtils.h"
-#include "nsICharsetConverterManager.h"
 #include "nsEncoderDecoderUtils.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsIUnicodeEncoder.h"
 
 #include "nsUConvCID.h"
-#include "nsCharsetConverterManager.h"
 #include "nsTextToSubURI.h"
 #include "nsUTF8ConverterService.h"
 #include "nsConverterInputStream.h"
 #include "nsConverterOutputStream.h"
 #include "nsScriptableUConv.h"
 #include "nsIOutputStream.h"
 #include "nsITextToSubURI.h"
 
@@ -291,19 +289,16 @@ NS_UCONV_REG_UNREG("x-johab", NS_JOHABTO
 NS_UCONV_REG_UNREG_DECODER("ISO-2022-KR", NS_ISO2022KRTOUNICODE_CID)
 
 // ucvcn
 NS_UCONV_REG_UNREG("GB2312", NS_GB2312TOUNICODE_CID, NS_UNICODETOGB2312_CID)
 NS_UCONV_REG_UNREG("gbk", NS_GBKTOUNICODE_CID, NS_UNICODETOGBK_CID)
 NS_UCONV_REG_UNREG("HZ-GB-2312", NS_HZTOUNICODE_CID, NS_UNICODETOHZ_CID)
 NS_UCONV_REG_UNREG("gb18030", NS_GB18030TOUNICODE_CID, NS_UNICODETOGB18030_CID)
 NS_UCONV_REG_UNREG_DECODER("ISO-2022-CN", NS_ISO2022CNTOUNICODE_CID)
-
-{ NS_TITLE_BUNDLE_CATEGORY, "chrome://global/locale/charsetTitles.properties", "" },
-{ NS_DATA_BUNDLE_CATEGORY, "resource://gre-resources/charsetData.properties", "" },
   
 NS_CONVERTER_REGISTRY_END
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToUTF8)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF8ToUnicode)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsReplacementToUnicode)
 
 // ucvlatin
@@ -449,24 +444,22 @@ const uint16_t g_ufKSC5601Mapping[] = {
 const uint16_t g_HangulNullMapping[] ={
   0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0xAC00, 0xD7A3, 0xAC00
 };
 
 const uint16_t g_ufJohabJamoMapping[] ={   
 #include "johabjamo.uf"
 };
 
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsCharsetConverterManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextToSubURI)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF8ConverterService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsConverterInputStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsConverterOutputStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableUnicodeConverter)
 
-NS_DEFINE_NAMED_CID(NS_ICHARSETCONVERTERMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_TEXTTOSUBURI_CID);
 NS_DEFINE_NAMED_CID(NS_CONVERTERINPUTSTREAM_CID);
 NS_DEFINE_NAMED_CID(NS_CONVERTEROUTPUTSTREAM_CID);
 NS_DEFINE_NAMED_CID(NS_ISCRIPTABLEUNICODECONVERTER_CID);
 NS_DEFINE_NAMED_CID(NS_UTF8CONVERTERSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_ISO88591TOUNICODE_CID);
 NS_DEFINE_NAMED_CID(NS_CP1252TOUNICODE_CID);
 NS_DEFINE_NAMED_CID(NS_MACROMANTOUNICODE_CID);
@@ -623,17 +616,16 @@ NS_DEFINE_NAMED_CID(NS_GBKTOUNICODE_CID)
 NS_DEFINE_NAMED_CID(NS_UNICODETOGBK_CID);
 NS_DEFINE_NAMED_CID(NS_HZTOUNICODE_CID);
 NS_DEFINE_NAMED_CID(NS_UNICODETOHZ_CID);
 NS_DEFINE_NAMED_CID(NS_GB18030TOUNICODE_CID);
 NS_DEFINE_NAMED_CID(NS_UNICODETOGB18030_CID);
 NS_DEFINE_NAMED_CID(NS_ISO2022CNTOUNICODE_CID);
 
 static const mozilla::Module::CIDEntry kUConvCIDs[] = {
-  { &kNS_ICHARSETCONVERTERMANAGER_CID, false, nullptr, nsCharsetConverterManagerConstructor },
   { &kNS_TEXTTOSUBURI_CID, false, nullptr, nsTextToSubURIConstructor },
   { &kNS_CONVERTERINPUTSTREAM_CID, false, nullptr, nsConverterInputStreamConstructor },
   { &kNS_CONVERTEROUTPUTSTREAM_CID, false, nullptr, nsConverterOutputStreamConstructor },
   { &kNS_ISCRIPTABLEUNICODECONVERTER_CID, false, nullptr, nsScriptableUnicodeConverterConstructor },
   { &kNS_UTF8CONVERTERSERVICE_CID, false, nullptr, nsUTF8ConverterServiceConstructor },
   { &kNS_ISO88591TOUNICODE_CID, false, nullptr, nsISO88591ToUnicodeConstructor },
   { &kNS_CP1252TOUNICODE_CID, false, nullptr, nsCP1252ToUnicodeConstructor },
   { &kNS_MACROMANTOUNICODE_CID, false, nullptr, nsMacRomanToUnicodeConstructor },
@@ -792,17 +784,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_UNICODETOHZ_CID, false, nullptr, nsUnicodeToHZConstructor },
   { &kNS_GB18030TOUNICODE_CID, false, nullptr, nsGB18030ToUnicodeConstructor },
   { &kNS_UNICODETOGB18030_CID, false, nullptr, nsUnicodeToGB18030Constructor },
   { &kNS_ISO2022CNTOUNICODE_CID, false, nullptr, nsISO2022CNToUnicodeConstructor },
   { nullptr },
 };
 
 static const mozilla::Module::ContractIDEntry kUConvContracts[] = {
-  { NS_CHARSETCONVERTERMANAGER_CONTRACTID, &kNS_ICHARSETCONVERTERMANAGER_CID },
   { NS_ITEXTTOSUBURI_CONTRACTID, &kNS_TEXTTOSUBURI_CID },
   { NS_CONVERTERINPUTSTREAM_CONTRACTID, &kNS_CONVERTERINPUTSTREAM_CID },
   { "@mozilla.org/intl/converter-output-stream;1", &kNS_CONVERTEROUTPUTSTREAM_CID },
   { NS_ISCRIPTABLEUNICODECONVERTER_CONTRACTID, &kNS_ISCRIPTABLEUNICODECONVERTER_CID },
   { NS_UTF8CONVERTERSERVICE_CONTRACTID, &kNS_UTF8CONVERTERSERVICE_CID },
   { NS_ISO88591TOUNICODE_CONTRACTID, &kNS_ISO88591TOUNICODE_CID },
   { NS_CP1252TOUNICODE_CONTRACTID, &kNS_CP1252TOUNICODE_CID },
   { NS_MACROMANTOUNICODE_CONTRACTID, &kNS_MACROMANTOUNICODE_CID },
--- a/intl/uconv/src/nsUTF8ConverterService.cpp
+++ b/intl/uconv/src/nsUTF8ConverterService.cpp
@@ -1,40 +1,40 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=4: 
  */
 /* 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 "nsString.h"
-#include "nsICharsetConverterManager.h"
 #include "nsUTF8ConverterService.h"
 #include "nsEscape.h"
 #include "nsAutoPtr.h"
-#include "nsServiceManagerUtils.h"
+#include "nsIUnicodeDecoder.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 NS_IMPL_ISUPPORTS(nsUTF8ConverterService, nsIUTF8ConverterService)
 
 static nsresult 
 ToUTF8(const nsACString &aString, const char *aCharset,
        bool aAllowSubstitution, nsACString &aResult)
 {
   nsresult rv;
   if (!aCharset || !*aCharset)
     return NS_ERROR_INVALID_ARG;
 
-  nsCOMPtr<nsICharsetConverterManager> ccm;
-
-  ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIUnicodeDecoder> unicodeDecoder;
-  rv = ccm->GetUnicodeDecoder(aCharset,
-                              getter_AddRefs(unicodeDecoder));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsDependentCString label(aCharset);
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
+  }
+  nsCOMPtr<nsIUnicodeDecoder> unicodeDecoder =
+    EncodingUtils::DecoderForEncoding(encoding);
 
   if (!aAllowSubstitution)
     unicodeDecoder->SetInputErrorBehavior(nsIUnicodeDecoder::kOnError_Signal);
 
   int32_t srcLen = aString.Length();
   int32_t dstLen;
   const nsAFlatCString& inStr = PromiseFlatCString(aString);
   rv = unicodeDecoder->GetMaxLength(inStr.get(), srcLen, &dstLen);
--- a/intl/uconv/tests/test_long_doc.html
+++ b/intl/uconv/tests/test_long_doc.html
@@ -20,39 +20,66 @@ https://bugzilla.mozilla.org/show_bug.cg
 /* Text longer than 2K bytes to ensure that it crosses a block boundary
    while decoding */
 const inString = "Many years ago, I contracted an intimacy with a Mr. William Legrand. He was of an ancient Huguenot family, and had once been wealthy; but a series of misfortunes had reduced him to want. To avoid the mortification consequent upon his disasters, he left New Orleans, the city of his forefathers, and took up his residence at Sullivan's Island, near Charleston, South Carolina. This island is a very singular one. It consists of little else than the sea sand, and is about three miles long. Its breadth at no point exceeds a quarter of a mile. It is separated from the mainland by a scarcely perceptible creek, oozing its way through a wilderness of reeds and slime, a favorite resort of the marsh-hen. The vegetation, as might be supposed, is scant, or at least dwarfish. No trees of any magnitude are to be seen. Near the western extremity, where Fort Moultrie stands, and where are some miserable frame buildings, tenanted, during summer, by the fugitives from Charleston dust and fever, may be found, indeed, the bristly palmetto; but the whole island, with the exception of this western point, and a line of hard, white beach on the sea-coast, is covered with a dense undergrowth of the sweet myrtle so much prized by the horticulturists of England. The shrub here often attains the height of fifteen or twenty feet, and forms an almost impenetrable coppice, burthening the air with its fragrance. In the inmost recesses of this coppice, not far from the eastern or more remote end of the island, Legrand had built himself a small hut, which he occupied when I first, by mere accident, made his acquaintance. This soon ripened into friendship -- for there was much in the recluse to excite interest and esteem. I found him well educated, with unusual powers of mind, but infected with misanthropy, and subject to perverse moods of alternate enthusiasm and melancholy. He had with him many books, but rarely employed them. His chief amusements were gunning and fishing, or sauntering along the beach and through the myrtles, in quest of shells or entomological specimens -- his collection of the latter might have been envied by a Swammerdamm. In these excursions he was usually accompanied by an old negro, called Jupiter, who had been manumitted before the reverses of the family, but who could be induced, neither by threats nor by promises, to abandon what he considered his right of attendance upon the footsteps of his young 'Massa Will.' It is not improbable that the relatives of Legrand, conceiving him to be somewhat unsettled in intellect, had contrived to instil this obstinacy into Jupiter, with a view to the supervision and guardianship of the wanderer. ";
 
 const testContent = "<pre id='testPara'>" + inString;
 
 const Ci = SpecialPowers.Ci;
 const Cc = SpecialPowers.Cc;
-var ccManager = Cc["@mozilla.org/charset-converter-manager;1"].getService(Ci.nsICharsetConverterManager);
-
-var decoderList = ccManager.getDecoderList();
-SimpleTest.waitForExplicitFinish();
-while (decoderList.hasMore()) {
-    var decoder =  decoderList.getNext();
 
-    // Skip UTF-16 variants. (Other non-ASCII compatible encodings will be
-    // ignored anyway because of bug 601429
-    if (decoder.substring(0, 6)  == "UTF-16" || 
-        decoder == "replacement" ||
-        decoder == "ISO-2022-KR" ||
-        decoder == "ISO-2022-CN")
-	continue;
+var decoders = [
+    "Big5",
+    "Big5-HKSCS",
+    "EUC-JP",
+    "EUC-KR",
+    "gb18030",
+    "IBM866",
+    "ISO-2022-JP",
+    "ISO-8859-3",
+    "ISO-8859-4",
+    "ISO-8859-5",
+    "ISO-8859-6",
+    "ISO-8859-7",
+    "ISO-8859-8",
+    "ISO-8859-8-I",
+    "ISO-8859-10",
+    "ISO-8859-13",
+    "ISO-8859-14",
+    "ISO-8859-15",
+    "ISO-8859-16",
+    "ISO-8859-2",
+    "KOI8-R",
+    "KOI8-U",
+    "Shift_JIS",
+    "windows-1250",
+    "windows-1251",
+    "windows-1252",
+    "windows-1253",
+    "windows-1254",
+    "windows-1255",
+    "windows-1256",
+    "windows-1257",
+    "windows-1258",
+    "windows-874",
+    "x-mac-cyrillic",
+    "UTF-8"
+];
 
-    data = encodeURI(testContent);
+var decoder;
+for (var i = 0; i < decoders.length; i++) {
+    var decoder = decoders[i];
+    var data = encodeURI(testContent);
     var dataURI = "data:text/html;charset=" + decoder + "," + data;
    
     var testFrame = document.createElement("iframe");
     frameID = decoder;
     testFrame.setAttribute("id", frameID);
     var testFrameObj = document.body.appendChild(testFrame);
-    if (decoderList.hasMore())
+    if (i < decoders.length)
         testFrameObj.setAttribute("onload", "testDecoding('" + decoder + "')");
     else
         testFrameObj.setAttribute("onload", "lastTest('" + decoder + "')");
     testFrameObj.contentDocument.location.assign(dataURI);
 }
 
 function lastTest(frame)
 {
--- a/intl/uconv/tests/unit/test_bug365345.js
+++ b/intl/uconv/tests/unit/test_bug365345.js
@@ -15,18 +15,18 @@ const expectedEnSpace = "Hello EnSpace";
 const expectedEmSpace = "Hello EmSpace";
 const expectedEuro = "HelloEUREuro";
 const expectedTamil1000 = "Hello[1000]Tamil1000";
 const expectedMonospace9 = "Hello9Monospace9";
 
 const EntityAfterCharsetConv = 512;
 const transliterate = 8;
 
-const charset = "ISO-8859-1";
-    
+const charset = "ISO-8859-2";
+
 function run_test() {
     var SaveAsCharset =
 	Components.Constructor("@mozilla.org/intl/saveascharset;1",
 			       "nsISaveAsCharset",
 			       "Init");
 
     var converter = new SaveAsCharset(charset,
 				      EntityAfterCharsetConv, 
deleted file mode 100644
--- a/intl/uconv/tests/unit/test_bug381412.johab.js
+++ /dev/null
@@ -1,60 +0,0 @@
-const charset = "x-johab";
-
-function dumpStrings(inString, outString) {
-    var dispIn = "";
-    var dispOut = "";
-    var i;
-    for (i = 0; i < inString.length; ++i) {
-	dispIn += " x" + inString.charCodeAt(i).toString(16);
-    }
-    if (outString.length == 0) {
-	dispOut = "<empty>";
-    } else {
-	for (i = 0; i < outString.length; ++i) {
-	    dispOut += " x" + outString.charCodeAt(i).toString(16);
-	}
-    }
-    dump("\"" + dispIn + "\" ==> \"" + dispOut + "\"\n");
-}
-
-function error(inString, outString, msg){
-    dumpStrings(inString, outString);
-    do_throw("security risk: " + msg);
-}
-
-function run_test() {
-    var ScriptableUnicodeConverter =
-	Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter",
-			       "nsIScriptableUnicodeConverter");
-
-    var converter = new ScriptableUnicodeConverter();
-    converter.charset = charset;
-
-    var leadByte, trailByte;
-    var inString;
-    for (leadByte = 1; leadByte < 0x100; ++leadByte) {
-	for (trailByte = 1; trailByte < 0x100; ++trailByte) {
-	    inString = String.fromCharCode(leadByte, trailByte, 65);
-	    var outString = converter.ConvertToUnicode(inString) + converter.Finish();
-	    switch (outString.length) {
-	        case 1:
-		    error(inString, outString, "2 byte sequence eaten");
-		    break;
-	        case 2:
-		    if (outString.charCodeAt(0) < 0x80 &&
-			outString.charCodeAt(1) < 0x80) {
-			error(inString, outString, "2 byte sequence converted to 1 ASCII");
-		    }
-		    break;
-	        case 3:
-		    if (outString != inString &&
-			outString.charCodeAt(0) < 0x80 &&
-			outString.charCodeAt(1) < 0x80) {
-			error(inString, outString,
-			      "2 byte sequence converted to 2 ASCII");
-		    }
-		    break;
-	    }
-	}
-    }
-}
deleted file mode 100644
--- a/intl/uconv/tests/unit/test_bug383018.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// Make sure that we can resolve the ascii charset alias to us-ascii
-// (bug 383018)
-
-function run_test() {
-  var ccm = Components.classes["@mozilla.org/charset-converter-manager;1"];
-  var ccms = ccm.getService(Components.interfaces.nsICharsetConverterManager);
-
-  var alias = ccms.getCharsetAlias("ascii");
-  // ascii should be an alias for us-ascii
-  do_check_eq(alias, "us-ascii");
-}
--- a/intl/uconv/tests/unit/test_bug399257.js
+++ b/intl/uconv/tests/unit/test_bug399257.js
@@ -1,32 +1,60 @@
 // Tests encoding of characters below U+0020
 load('CharsetConversionTests.js');
 
 const inString = "Hello\u000aWorld";
 const expectedString = "Hello\nWorld";
 
 function run_test() {
     var failures = false;
-    var ccManager = Cc["@mozilla.org/charset-converter-manager;1"]
-        .getService(Ci.nsICharsetConverterManager);
-    var encodingConverter = CreateScriptableConverter();
 
-    var charsetList = ccManager.getDecoderList();
+    var decoders = [
+        "Big5",
+        "Big5-HKSCS",
+        "EUC-JP",
+        "EUC-KR",
+        "gb18030",
+        "IBM866",
+        "ISO-2022-JP",
+        "ISO-8859-3",
+        "ISO-8859-4",
+        "ISO-8859-5",
+        "ISO-8859-6",
+        "ISO-8859-7",
+        "ISO-8859-8",
+        "ISO-8859-8-I",
+        "ISO-8859-10",
+        "ISO-8859-13",
+        "ISO-8859-14",
+        "ISO-8859-15",
+        "ISO-8859-16",
+        "ISO-8859-2",
+        "KOI8-R",
+        "KOI8-U",
+        "Shift_JIS",
+        "windows-1250",
+        "windows-1251",
+        "windows-1252",
+        "windows-1253",
+        "windows-1254",
+        "windows-1255",
+        "windows-1256",
+        "windows-1257",
+        "windows-1258",
+        "windows-874",
+        "x-mac-cyrillic",
+        "UTF-8"
+    ];
+
     var counter = 0;
-    while (charsetList.hasMore()) {
+    while (counter < decoders.length) {
 	++counter;
-	var charset = charsetList.getNext();
+	var charset = decoders[counter];
 
-	// exclude known non-ASCII compatible charsets
-	if (charset.substr(0, "UTF-16".length) == "UTF-16" ||
-	    charset == "x-imap4-modified-utf7") {
-	    dump("skipping " + counter + " " + charset + "\n");
-	    continue;
-	}
         dump("testing " + counter + " " + charset + "\n");
 
         try {
             encodingConverter.charset = charset;
         } catch(e) {
             dump("Warning: couldn't set encoder charset to " + charset + "\n");
             continue;
         }
deleted file mode 100644
--- a/intl/uconv/tests/unit/test_bug399284.js
+++ /dev/null
@@ -1,21 +0,0 @@
-function run_test()
-{
-    var failures = false;
-    var ccManager =
-	Components.classes["@mozilla.org/charset-converter-manager;1"]
-	.getService(Components.interfaces.nsICharsetConverterManager);
-
-    var decoderList = ccManager.getDecoderList();
-    while (decoderList.hasMore()) {
-	var decoder = decoderList.getNext();
-	try {
-	    var langGroup = ccManager.getCharsetLangGroupRaw(decoder);
-	} catch(e) {
-	    dump("no langGroup for " + decoder + "\n");
-	    failures = true;
-	}
-    }
-    if (failures) {
-	do_throw("missing langGroups");
-    }
-}
deleted file mode 100644
--- a/intl/uconv/tests/unit/test_bug449578.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Tests conversion from ISO-2022-KR to Unicode (bug 449578)
- */
-
-// designator sequence at beginning of line - legal
-const in1 = "%1B$)C%0E0!3*4Y6s%0F 1234";     
-// empty non-ASCII sequence -- illegal
-const in2 = "%1B$)Cab%0E%0Fcd";
-// designator sequence not at beginning of line - illegal
-const in3 = "abc %1B$)C%0E0!3*4Y6s%0F 1234";
-
-const expected1 = "\uAC00\uB098\uB2E4\uB77C 1234";
-const expected2 = "ab\uFFFD\cd";
-const expected3 = "abc \u001B$)C\uAC00\uB098\uB2E4\uB77C 1234";
-
-function testCase(inStr, expected)
-{
-    var dataURI = "data:text/plain;charset=ISO-2022-KR," + inStr;
-
-    var IOService = Components.Constructor("@mozilla.org/network/io-service;1",
-					 "nsIIOService");
-    var ConverterInputStream =
-	Components.Constructor("@mozilla.org/intl/converter-input-stream;1",
-			       "nsIConverterInputStream",
-			       "init");
-
-    var ios = new IOService();
-    var channel = ios.newChannel(dataURI, "", null);
-    var testInputStream = channel.open();
-    var testConverter = new ConverterInputStream(testInputStream,
-						 "ISO-2022-KR",
-						 8192,
-						 0xFFFD);
-
-    if (!(testConverter instanceof
-	  Components.interfaces.nsIUnicharLineInputStream))
-	throw "not line input stream";
-
-    var outStr = "";
-    var more;
-    do {
-	// read the line and check for eof
-	var line = {};
-	more = testConverter.readLine(line);
-	outStr += line.value;
-    } while (more);
-
-    do_check_eq(outStr, expected);
-}
-    
-function run_test()
-{
-    testCase(in1, expected1);
-    testCase(in2, expected2);
-    testCase(in3, expected3);
-}
--- a/intl/uconv/tests/unit/test_bug601429.js
+++ b/intl/uconv/tests/unit/test_bug601429.js
@@ -1,23 +1,57 @@
 // Tests whether characters above 0x7F decode to ASCII characters liable to 
 // expose XSS vulnerabilities
 load('CharsetConversionTests.js');
 
 function run_test() {
   var failures = false;
-  var ccManager = Cc["@mozilla.org/charset-converter-manager;1"]
-        .getService(Ci.nsICharsetConverterManager);
-  var decodingConverter = CreateScriptableConverter();
 
-  var charsetList = ccManager.getDecoderList();
+  var decoders = [
+    "Big5",
+    "Big5-HKSCS",
+    "EUC-JP",
+    "EUC-KR",
+    "gb18030",
+    "IBM866",
+    "ISO-2022-JP",
+    "ISO-8859-3",
+    "ISO-8859-4",
+    "ISO-8859-5",
+    "ISO-8859-6",
+    "ISO-8859-7",
+    "ISO-8859-8",
+    "ISO-8859-8-I",
+    "ISO-8859-10",
+    "ISO-8859-13",
+    "ISO-8859-14",
+    "ISO-8859-15",
+    "ISO-8859-16",
+    "ISO-8859-2",
+    "KOI8-R",
+    "KOI8-U",
+    "Shift_JIS",
+    "windows-1250",
+    "windows-1251",
+    "windows-1252",
+    "windows-1253",
+    "windows-1254",
+    "windows-1255",
+    "windows-1256",
+    "windows-1257",
+    "windows-1258",
+    "windows-874",
+    "x-mac-cyrillic",
+    "UTF-8"
+  ];
+
   var counter = 0;
-  while (charsetList.hasMore()) {
+  while (counter < decoders.length) {
     ++counter;
-    var charset = charsetList.getNext();
+    var charset = decoders[counter];
     dump("testing " + counter + " " + charset + "\n");
       
     try {
       decodingConverter.charset = charset;
     } catch(e) {
       dump("Warning: couldn't set decoder charset to " + charset + "\n");
       continue;
     }
deleted file mode 100644
--- a/intl/uconv/tests/unit/test_bug713519.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 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/. */
-
-function run_test() {
-  let svc =  Components.classes["@mozilla.org/charset-converter-manager;1"]
-                       .getService(Components.interfaces.nsICharsetConverterManager);
-
-  // Ensure normal calls to getCharsetAlias do work.
-  do_check_eq(svc.getCharsetAlias("Windows-1255"), "windows-1255");
-
-  try {
-    svc.getCharsetAlias("no such thing");
-    do_throw("Calling getCharsetAlias with invalid value should throw.");
-  }
-  catch (ex) {
-    // The exception is expected.
-  }
-}
--- a/intl/uconv/tests/unit/test_bug715319.dbcs.js
+++ b/intl/uconv/tests/unit/test_bug715319.dbcs.js
@@ -1,10 +1,10 @@
 // 2-byte charsets:
-const charsets = [ "Big5", "EUC-KR", "x-euc-tw", "x-johab" ]
+const charsets = [ "Big5", "EUC-KR" ]
 const ScriptableUnicodeConverter =
 	Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter",
 			       "nsIScriptableUnicodeConverter");
 var gConverter;
 
 function error(inString, outString, msg) {
     var dispIn = "";
     var dispOut = "";
--- a/intl/uconv/tests/unit/test_decode_CP1251.js
+++ b/intl/uconv/tests/unit/test_decode_CP1251.js
@@ -1,13 +1,13 @@
 // Tests conversion from windows-1251 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u0459\u203a\u045a\u045c\u045b\u045f\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f";
 
-const aliases = [ "windows-1251", "x-cp1251", "cp1251", "ansi-1251" ];
+const aliases = [ "windows-1251", "x-cp1251", "cp1251" ];
 
 function run_test() {
   testDecodeAliases();
 }
--- a/intl/uconv/tests/unit/test_decode_CP850.js
+++ b/intl/uconv/tests/unit/test_decode_CP850.js
@@ -1,13 +1,14 @@
 // Tests conversion from IBM850 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00f0\u00d0\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00fe\u00de\u00da\u00db\u00d9\u00fd\u00dd\u00af\u00b4\u00ad\u00b1\u2017\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0";
 
-const aliases = [ "IBM850", "ibm850", "cp850", "850", "csibm850" ];
+//const aliases = [ "IBM850", "ibm850", "cp850", "850", "csibm850" ];
+const aliases = [ "IBM850" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_CP852.js
+++ b/intl/uconv/tests/unit/test_decode_CP852.js
@@ -1,13 +1,14 @@
 // Tests conversion from IBM852 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u016f\u0107\u00e7\u0142\u00eb\u0150\u0151\u00ee\u0179\u00c4\u0106\u00c9\u0139\u013a\u00f4\u00f6\u013d\u013e\u015a\u015b\u00d6\u00dc\u0164\u0165\u0141\u00d7\u010d\u00e1\u00ed\u00f3\u00fa\u0104\u0105\u017d\u017e\u0118\u0119\u20ac\u017a\u010c\u015f\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u011a\u015e\u2563\u2551\u2557\u255d\u017b\u017c\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u0102\u0103\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u0111\u0110\u010e\u00cb\u010f\u0147\u00cd\u00ce\u011b\u2518\u250c\u2588\u2584\u0162\u016e\u2580\u00d3\u00df\u00d4\u0143\u0144\u0148\u0160\u0161\u0154\u00da\u0155\u0170\u00fd\u00dd\u0163\u00b4\u00ad\u02dd\u02db\u02c7\u02d8\u00a7\u00f7\u00b8\u00b0\u00a8\u02d9\u0171\u0158\u0159\u25a0\u00a0";
 
-const aliases = [ "IBM852", "ibm852", "cp852", "852", "csibm852" ];
+//const aliases = [ "IBM852", "ibm852", "cp852", "852", "csibm852" ];
+const aliases = [ "IBM852" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_CP855.js
+++ b/intl/uconv/tests/unit/test_decode_CP855.js
@@ -1,13 +1,14 @@
 // Tests conversion from IBM855 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045a\u040a\u045b\u040b\u045c\u040c\u045e\u040e\u045f\u040f\u044e\u042e\u044a\u042a\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255d\u0439\u0419\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u043a\u041a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u043b\u041b\u043c\u041c\u043d\u041d\u043e\u041e\u043f\u2518\u250c\u2588\u2584\u041f\u044f\u2580\u042f\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044c\u042c\u2116\u00ad\u044b\u042b\u0437\u0417\u0448\u0428\u044d\u042d\u0449\u0429\u0447\u0427\u00a7\u25a0\u00a0";
 
-const aliases = [ "IBM855", "ibm855", "cp855", "855", "csibm855" ];
+//const aliases = [ "IBM855", "ibm855", "cp855", "855", "csibm855" ];
+const aliases = [ "IBM855" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_CP857.js
+++ b/intl/uconv/tests/unit/test_decode_CP857.js
@@ -1,13 +1,14 @@
 // Tests conversion from IBM857 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u0131\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u0130\u00d6\u00dc\u00f8\u00a3\u00d8\u015e\u015f\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u011e\u011f\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00ba\u00aa\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00d7\u00da\u00db\u00d9\u00ec\u00ff\u00af\u00b4\u00ad\u00b1\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0";
 
-const aliases = [ "IBM857", "ibm857", "cp857", "857", "csibm857" ];
+//const aliases = [ "IBM857", "ibm857", "cp857", "857", "csibm857" ];
+const aliases = [ "IBM857" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_CP862.js
+++ b/intl/uconv/tests/unit/test_decode_CP862.js
@@ -1,13 +1,14 @@
 // Tests conversion from IBM862 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u00a2\u00a3\u00a5\u20aa\u200e\u200f\u202a\u202b\u202d\u202c\u202e\u2310\u00ac\u00bd\u00bc\u20ac\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u00a0";
 
-const aliases = [ "IBM862", "ibm862", "cp862", "862", "csibm862" ];
+//const aliases = [ "IBM862", "ibm862", "cp862", "862", "csibm862" ];
+const aliases = [ "IBM862" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_CP864.js
+++ b/intl/uconv/tests/unit/test_decode_CP864.js
@@ -1,13 +1,15 @@
 // Tests conversion from IBM864 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9d\x9e\xa0\xa1\xa2\xa3\xa4\xa5\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe";
     
 const expectedString = " !\"#$\u066a&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00b0\u00b7\u2219\u221a\u2592\u2500\u2502\u253c\u2524\u252c\u251c\u2534\u2510\u250c\u2514\u2518\u03b2\u221e\u03c6\u00b1\u00bd\u00bc\u2248\u00ab\u00bb\ufef7\ufef8\ufefb\ufefc\u00a0\u00ad\ufe82\u00a3\u00a4\ufe84\u20ac\ufe8e\ufe8f\ufe95\ufe99\u060c\ufe9d\ufea1\ufea5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\ufed1\u061b\ufeb1\ufeb5\ufeb9\u061f\u00a2\ufe80\ufe81\ufe83\ufe85\ufeca\ufe8b\ufe8d\ufe91\ufe93\ufe97\ufe9b\ufe9f\ufea3\ufea7\ufea9\ufeab\ufead\ufeaf\ufeb3\ufeb7\ufebb\ufebf\ufec1\ufec5\ufecb\ufecf\u00a6\u00ac\u00f7\u00d7\ufec9\u0640\ufed3\ufed7\ufedb\ufedf\ufee3\ufee7\ufeeb\ufeed\ufeef\ufef3\ufebd\ufecc\ufece\ufecd\ufee1\ufe7d\u0651\ufee5\ufee9\ufeec\ufef0\ufef2\ufed0\ufed5\ufef5\ufef6\ufedd\ufed9\ufef1\u25a0";
 
-const aliases = [ "IBM864", "ibm864", "cp864", "864", "csibm864", "ibm-864" ];
+// const aliases = [ "IBM864", "ibm864", "cp864", "864", "csibm864", "ibm-864" ];
+// Aliases no longer supported for internal encodings in the test harness
+const aliases = [ "IBM864" ];
 
 function run_test() {
   testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_CP874.js
+++ b/intl/uconv/tests/unit/test_decode_CP874.js
@@ -1,13 +1,13 @@
 // Tests conversion from windows-874 to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x85\x91\x92\x93\x94\x95\x96\x97\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u2026\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u00a0\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\u0e3f\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c\u0e4d\u0e4e\u0e4f\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59\u0e5a\u0e5b";
 
-const aliases = [ "windows-874", "ibm874", "dos-874" ];
+const aliases = [ "windows-874", "dos-874" ];
 
 function run_test() {
   testDecodeAliases();
 }
--- a/intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js
+++ b/intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js
@@ -1,15 +1,15 @@
 // Tests conversion of 8-byte decomposed Hangul from EUC-KR (and variants)
 // to Unicode, including invalid input
         
 load('CharsetConversionTests.js');
 load('hangulTestStrings.js');
 
-const aliases = [ "euc-kr", "EUC-KR", "iso-ir-149", "ks_c_5601-1989", "ksc_5601", "ksc5601", "korean", "csksc56011987", "5601", "windows-949", "ks_c_5601-1987", "cseuckr"];
+const aliases = [ "euc-kr", "EUC-KR", "iso-ir-149", "ks_c_5601-1989", "ksc_5601", "ksc5601", "korean", "csksc56011987", "windows-949", "ks_c_5601-1987", "cseuckr"];
 
 function to8byteHangul(byte3, byte5, byte7)
 {
     return String.fromCharCode(0xa4, 0xd4, 0xa4, byte3, 0xa4, byte5, 0xa4, byte7);
 }
 
 function run_test() {
     var converter = CreateScriptableConverter();
--- a/intl/uconv/tests/unit/test_decode_armscii.js
+++ b/intl/uconv/tests/unit/test_decode_armscii.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0587\u0589)(\u00bb\u00ab\u2014.\u055d,-\u058a\u2026\u055c\u055b\u055e\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053a\u056a\u053b\u056b\u053c\u056c\u053d\u056d\u053e\u056e\u053f\u056f\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054a\u057a\u054b\u057b\u054c\u057c\u054d\u057d\u054e\u057e\u054f\u057f\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055a";
 
 const aliases = ["armscii-8"];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_tcvn5712.js
+++ b/intl/uconv/tests/unit/test_decode_tcvn5712.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = "\u00da\u1ee4\u1eea\u1eec\u1eee\u1ee8\u1ef0\u1ef2\u1ef6\u1ef8\u00dd\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u00c1\u1ea0\u1eb6\u1eac\u00c8\u1eba\u1ebc\u00c9\u1eb8\u1ec6\u00cc\u1ec8\u0128\u00cd\u1eca\u00d2\u1ece\u00d5\u00d3\u1ecc\u1ed8\u1edc\u1ede\u1ee0\u1eda\u1ee2\u00d9\u1ee6\u0168\u00a0\u0102\u00c2\u00ca\u00d4\u01a0\u01af\u0110\u0103\u00e2\u00ea\u00f4\u01a1\u01b0\u0111\u1eb0\u0300\u0309\u0303\u0301\u0323\u00e0\u1ea3\u00e3\u00e1\u1ea1\u1eb2\u1eb1\u1eb3\u1eb5\u1eaf\u1eb4\u1eae\u1ea6\u1ea8\u1eaa\u1ea4\u1ec0\u1eb7\u1ea7\u1ea9\u1eab\u1ea5\u1ead\u00e8\u1ec2\u1ebb\u1ebd\u00e9\u1eb9\u1ec1\u1ec3\u1ec5\u1ebf\u1ec7\u00ec\u1ec9\u1ec4\u1ebe\u1ed2\u0129\u00ed\u1ecb\u00f2\u1ed4\u1ecf\u00f5\u00f3\u1ecd\u1ed3\u1ed5\u1ed7\u1ed1\u1ed9\u1edd\u1edf\u1ee1\u1edb\u1ee3\u00f9\u1ed6\u1ee7\u0169\u00fa\u1ee5\u1eeb\u1eed\u1eef\u1ee9\u1ef1\u1ef3\u1ef7\u1ef9\u00fd\u1ef5\u1ed0";
 
 const aliases = [ "x-viet-tcvn5712" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_viscii.js
+++ b/intl/uconv/tests/unit/test_decode_viscii.js
@@ -1,13 +1,14 @@
 // Tests conversion from viscii to Unicode
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = "\u1eb2\u1eb4\u1eaa\u1ef6\u1ef8\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u1ea0\u1eae\u1eb0\u1eb6\u1ea4\u1ea6\u1ea8\u1eac\u1ebc\u1eb8\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1ee2\u1eda\u1edc\u1ede\u1eca\u1ece\u1ecc\u1ec8\u1ee6\u0168\u1ee4\u1ef2\u00d5\u1eaf\u1eb1\u1eb7\u1ea5\u1ea7\u1ea9\u1ead\u1ebd\u1eb9\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ed1\u1ed3\u1ed5\u1ed7\u1ee0\u01a0\u1ed9\u1edd\u1edf\u1ecb\u1ef0\u1ee8\u1eea\u1eec\u01a1\u1edb\u01af\u00c0\u00c1\u00c2\u00c3\u1ea2\u0102\u1eb3\u1eb5\u00c8\u00c9\u00ca\u1eba\u00cc\u00cd\u0128\u1ef3\u0110\u1ee9\u00d2\u00d3\u00d4\u1ea1\u1ef7\u1eeb\u1eed\u00d9\u00da\u1ef9\u1ef5\u00dd\u1ee1\u01b0\u00e0\u00e1\u00e2\u00e3\u1ea3\u0103\u1eef\u1eab\u00e8\u00e9\u00ea\u1ebb\u00ec\u00ed\u0129\u1ec9\u0111\u1ef1\u00f2\u00f3\u00f4\u00f5\u1ecf\u1ecd\u1ee5\u00f9\u00fa\u0169\u1ee7\u00fd\u1ee3\u1eee";
 
-const aliases = [ "VISCII", "viscii", "csviscii" ];
+//const aliases = [ "VISCII", "viscii", "csviscii" ];
+const aliases = [ "VISCII" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_vps.js
+++ b/intl/uconv/tests/unit/test_decode_vps.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = "\u1ea0\u1eac\u1eb6\u1eb8\u1ec6\u1eca\u1ecc\u1ed8\u1ee2\u1ee4\u1ef0\u1ef4\u1eaa\u1eee !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u1ea4\u1ea6\u1ea8\u1ecd\u1ed7\u0102\u1ebf\u1ec1\u1ec3\u1ec7\u1eae\u1eb0\u1eb2\u1ebe\u2018\u2019\u1ec0\u1ec2\u1ec4\u1ed0\u1ed2\u1ed4\u1ed6\u00fd\u1ef7\u1ef5\u1eda\u1edc\u1ede\u00a0\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1ee0\u1edb\u00d9\u1edd\u1edf\u1ee1\u0168\u1ee8\u1ee3\u1eea\u1ed5\u1eec\u1ef2\u1ef8\u00cd\u00cc\u1ed9\u1ec8\u0128\u00d3\u1eed\u1eef\u00d2\u1ece\u00d5\u1ef1\u1ea7\u00c1\u00c2\u1ea5\u1ea9\u1eab\u1ead\u0111\u1ebb\u00c9\u00ca\u1eb9\u1ec9\u1ec5\u1ecb\u1ef9\u01af\u1ee6\u1ed3\u1ed1\u00d4\u1ecf\u01a1\u00c8\u1eeb\u1ee9\u00da\u0169\u01b0\u00dd\u1eba\u00df\u00e0\u00e1\u00e2\u00e3\u1ea3\u1ea1\u0103\u00e7\u00e8\u00e9\u00ea\u1ebd\u00ec\u00ed\u00ee\u0129\u1eb4\u0110\u00f2\u00f3\u00f4\u00f5\u00f6\u01a0\u1ee5\u00f9\u00fa\u1ee7\u00fc\u1ef6\u1ebc\u1ef3";
 
 const aliases = [ "x-viet-vps" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_ce.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_ce.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u0100\u0101\u00c9\u0104\u00d6\u00dc\u00e1\u0105\u010c\u00e4\u010d\u0106\u0107\u00e9\u0179\u017a\u010e\u00ed\u010f\u0112\u0113\u0116\u00f3\u0117\u00f4\u00f6\u00f5\u00fa\u011a\u011b\u00fc\u2020\u00b0\u0118\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u0119\u00a8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\u00ac\u221a\u0144\u0147\u2206\u00ab\u00bb\u2026\u00a0\u0148\u0150\u00d5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\u00c1\u0164\u0165\u00cd\u017d\u017e\u016a\u00d3\u00d4\u016b\u016e\u00da\u016f\u0170\u0171\u0172\u0173\u00dd\u00fd\u0137\u017b\u0141\u017c\u0122\u02c7";
 
 const aliases = [ "x-mac-ce" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_croatian.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_croatian.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u0160\u2122\u00b4\u00a8\u2260\u017d\u00d8\u221e\u00b1\u2264\u2265\u2206\u00b5\u2202\u2211\u220f\u0161\u222b\u00aa\u00ba\u03a9\u017e\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u0106\u00ab\u010c\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\uf8ff\u00a9\u2044\u20ac\u2039\u203a\u00c6\u00bb\u2013\u00b7\u201a\u201e\u2030\u00c2\u0107\u00c1\u010d\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\u0111\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u03c0\u00cb\u02da\u00b8\u00ca\u00e6\u02c7";
 
 const aliases = [ "x-mac-croatian" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_cyrillic.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_cyrillic.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\u00b0\u0490\u00a3\u00a7\u2022\u00b6\u0406\u00ae\u00a9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\u00b1\u2264\u2265\u0456\u00b5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u20ac";
 
 const aliases = [ "x-mac-cyrillic" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_devanagari.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_devanagari.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x90\x91\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0970\u0901\u0902\u0903\u0905\u0906\u0907\u0908\u0909\u090a\u090b\u090e\u090f\u0910\u090d\u0912\u0913\u0914\u0911\u0915\u0916\u0917\u0918\u0919\u091a\u091b\u091c\u091d\u091e\u091f\u0920\u0921\u0922\u0923\u0924\u0925\u0926\u0927\u0928\u0929\u092a\u092b\u092c\u092d\u092e\u092f\u095f\u0930\u0931\u0932\u0933\u0934\u0935\u0936\u0937\u0938\u0939\u200e\u093e\u093f\u0940\u0941\u0942\u0943\u0946\u0947\u0948\u0945\u094a\u094b\u094c\u0949\u094d\u093c\u0964\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f";
 
 const aliases = [ "x-mac-devanagari" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_greek.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_greek.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00b9\u00b2\u00c9\u00b3\u00d6\u00dc\u0385\u00e0\u00e2\u00e4\u0384\u00a8\u00e7\u00e9\u00e8\u00ea\u00eb\u00a3\u2122\u00ee\u00ef\u2022\u00bd\u2030\u00f4\u00f6\u00a6\u20ac\u00f9\u00fb\u00fc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\u00df\u00ae\u00a9\u03a3\u03aa\u00a7\u2260\u00b0\u00b7\u0391\u00b1\u2264\u2265\u00a5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\u00ac\u039f\u03a1\u2248\u03a4\u00ab\u00bb\u2026\u00a0\u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\u00f7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\u00ad";
 
 const aliases = [ "x-mac-greek" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_gujarati.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_gujarati.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x90\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xac\xad\xae\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc8\xc9\xca\xcb\xcc\xcd\xcf\xd1\xd2\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe1\xe2\xe3\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0a81\u0a82\u0a83\u0a85\u0a86\u0a87\u0a88\u0a89\u0a8a\u0a8b\u0a8f\u0a90\u0a8d\u0a93\u0a94\u0a91\u0a95\u0a96\u0a97\u0a98\u0a99\u0a9a\u0a9b\u0a9c\u0a9d\u0a9e\u0a9f\u0aa0\u0aa1\u0aa2\u0aa3\u0aa4\u0aa5\u0aa6\u0aa7\u0aa8\u0aaa\u0aab\u0aac\u0aad\u0aae\u0aaf\u0ab0\u0ab2\u0ab3\u0ab5\u0ab6\u0ab7\u0ab8\u0ab9\u200e\u0abe\u0abf\u0ac0\u0ac1\u0ac2\u0ac3\u0ac7\u0ac8\u0ac5\u0acb\u0acc\u0ac9\u0acd\u0abc\u0964\u0ae6\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef";
 
 const aliases = [ "x-mac-gujarati" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_gurmukhi.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_gurmukhi.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x90\x91\x92\x93\x94\xa2\xa4\xa5\xa6\xa7\xa8\xa9\xac\xad\xb0\xb1\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc8\xc9\xca\xcb\xcc\xcd\xcf\xd1\xd4\xd5\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xe1\xe2\xe5\xe6\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0a71\u0a5c\u0a73\u0a72\u0a74\u0a02\u0a05\u0a06\u0a07\u0a08\u0a09\u0a0a\u0a0f\u0a10\u0a13\u0a14\u0a15\u0a16\u0a17\u0a18\u0a19\u0a1a\u0a1b\u0a1c\u0a1d\u0a1e\u0a1f\u0a20\u0a21\u0a22\u0a23\u0a24\u0a25\u0a26\u0a27\u0a28\u0a2a\u0a2b\u0a2c\u0a2d\u0a2e\u0a2f\u0a30\u0a32\u0a35\uf860\u0a38\u0a39\u200e\u0a3e\u0a3f\u0a40\u0a41\u0a42\u0a47\u0a48\u0a4b\u0a4c\u0a4d\u0a3c\u0964\u0a66\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f";
 
 const aliases = [ "x-mac-gurmukhi" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_icelandic.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_icelandic.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u00dd\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u00d0\u00f0\u00de\u00fe\u00fd\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7";
 
 const aliases = [ "x-mac-icelandic" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_romanian.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_romanian.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u0102\u0218\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u0103\u0219\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7";
 
 const aliases = [ "x-mac-romanian" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_decode_x_mac_turkish.js
+++ b/intl/uconv/tests/unit/test_decode_x_mac_turkish.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\uf8a0\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7";
 
 const aliases = [ "x-mac-turkish" ];
 
 function run_test() {
-  testDecodeAliases();
+  testDecodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP1251.js
+++ b/intl/uconv/tests/unit/test_encode_CP1251.js
@@ -1,13 +1,13 @@
 // Tests conversion from Unicode to windows-1251
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u0459\u203a\u045a\u045c\u045b\u045f\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "windows-1251", "x-cp1251", "cp1251", "ansi-1251" ];
+const aliases = [ "windows-1251", "x-cp1251", "cp1251" ];
 
 function run_test() {
   testEncodeAliases();
 }
--- a/intl/uconv/tests/unit/test_encode_CP850.js
+++ b/intl/uconv/tests/unit/test_encode_CP850.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to IBM850
 
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00f0\u00d0\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00fe\u00de\u00da\u00db\u00d9\u00fd\u00dd\u00af\u00b4\u00ad\u00b1\u2017\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "IBM850", "ibm850", "cp850", "850", "csibm850" ];
+//const aliases = [ "IBM850", "ibm850", "cp850", "850", "csibm850" ];
+const aliases = [ "IBM850" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP852.js
+++ b/intl/uconv/tests/unit/test_encode_CP852.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to IBM852
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u016f\u0107\u00e7\u0142\u00eb\u0150\u0151\u00ee\u0179\u00c4\u0106\u00c9\u0139\u013a\u00f4\u00f6\u013d\u013e\u015a\u015b\u00d6\u00dc\u0164\u0165\u0141\u00d7\u010d\u00e1\u00ed\u00f3\u00fa\u0104\u0105\u017d\u017e\u0118\u0119\u20ac\u017a\u010c\u015f\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u011a\u015e\u2563\u2551\u2557\u255d\u017b\u017c\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u0102\u0103\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u0111\u0110\u010e\u00cb\u010f\u0147\u00cd\u00ce\u011b\u2518\u250c\u2588\u2584\u0162\u016e\u2580\u00d3\u00df\u00d4\u0143\u0144\u0148\u0160\u0161\u0154\u00da\u0155\u0170\u00fd\u00dd\u0163\u00b4\u00ad\u02dd\u02db\u02c7\u02d8\u00a7\u00f7\u00b8\u00b0\u00a8\u02d9\u0171\u0158\u0159\u25a0\u00a0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "IBM852", "ibm852", "cp852", "852", "csibm852" ];
+//const aliases = [ "IBM852", "ibm852", "cp852", "852", "csibm852" ];
+const aliases = [ "IBM852" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP855.js
+++ b/intl/uconv/tests/unit/test_encode_CP855.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to IBM855
 
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045a\u040a\u045b\u040b\u045c\u040c\u045e\u040e\u045f\u040f\u044e\u042e\u044a\u042a\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255d\u0439\u0419\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u043a\u041a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u043b\u041b\u043c\u041c\u043d\u041d\u043e\u041e\u043f\u2518\u250c\u2588\u2584\u041f\u044f\u2580\u042f\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044c\u042c\u2116\u00ad\u044b\u042b\u0437\u0417\u0448\u0428\u044d\u042d\u0449\u0429\u0447\u0427\u00a7\u25a0\u00a0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "IBM855", "ibm855", "cp855", "855", "csibm855" ];
+//const aliases = [ "IBM855", "ibm855", "cp855", "855", "csibm855" ];
+const aliases = [ "IBM855" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP857.js
+++ b/intl/uconv/tests/unit/test_encode_CP857.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to IBM857
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u0131\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u0130\u00d6\u00dc\u00f8\u00a3\u00d8\u015e\u015f\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u011e\u011f\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00ba\u00aa\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00d7\u00da\u00db\u00d9\u00ec\u00ff\u00af\u00b4\u00ad\u00b1\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "IBM857", "ibm857", "cp857", "857", "csibm857" ];
+//const aliases = [ "IBM857", "ibm857", "cp857", "857", "csibm857" ];
+const aliases = [ "IBM857" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP862.js
+++ b/intl/uconv/tests/unit/test_encode_CP862.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to IBM862
 
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u00a2\u00a3\u00a5\u20aa\u200e\u200f\u202a\u202b\u202d\u202c\u202e\u2310\u00ac\u00bd\u00bc\u20ac\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u00a0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "IBM862", "ibm862", "cp862", "862", "csibm862" ];
+//const aliases = [ "IBM862", "ibm862", "cp862", "862", "csibm862" ];
+const aliases = [ "IBM862" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP864.js
+++ b/intl/uconv/tests/unit/test_encode_CP864.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to IBM864
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$\u066a&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00b0\u00b7\u2219\u221a\u2592\u2500\u2502\u253c\u2524\u252c\u251c\u2534\u2510\u250c\u2514\u2518\u03b2\u221e\u03c6\u00b1\u00bd\u00bc\u2248\u00ab\u00bb\ufef7\ufef8\ufefb\ufefc\u00a0\u00ad\ufe82\u00a3\u00a4\ufe84\u20ac\ufe8e\ufe8f\ufe95\ufe99\u060c\ufe9d\ufea1\ufea5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\ufed1\u061b\ufeb1\ufeb5\ufeb9\u061f\u00a2\ufe80\ufe81\ufe83\ufe85\ufeca\ufe8b\ufe8d\ufe91\ufe93\ufe97\ufe9b\ufe9f\ufea3\ufea7\ufea9\ufeab\ufead\ufeaf\ufeb3\ufeb7\ufebb\ufebf\ufec1\ufec5\ufecb\ufecf\u00a6\u00ac\u00f7\u00d7\ufec9\u0640\ufed3\ufed7\ufedb\ufedf\ufee3\ufee7\ufeeb\ufeed\ufeef\ufef3\ufebd\ufecc\ufece\ufecd\ufee1\ufe7d\u0651\ufee5\ufee9\ufeec\ufef0\ufef2\ufed0\ufed5\ufef5\ufef6\ufedd\ufed9\ufef1\u25a0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9d\x9e\xa0\xa1\xa2\xa3\xa4\xa5\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe";
 
-const aliases = [ "IBM864", "ibm864", "cp864", "864", "csibm864", "ibm-864" ];
+//const aliases = [ "IBM864", "ibm864", "cp864", "864", "csibm864", "ibm-864" ];
+const aliases = [ "IBM864" ];
 
 function run_test() {
   testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_CP874.js
+++ b/intl/uconv/tests/unit/test_encode_CP874.js
@@ -1,13 +1,13 @@
 // Tests conversion from Unicode to windows-874
 	
 load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u2026\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u00a0\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\u0e3f\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c\u0e4d\u0e4e\u0e4f\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59\u0e5a\u0e5b";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x85\x91\x92\x93\x94\x95\x96\x97\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb";
 
-const aliases = [ "windows-874", "ibm874", "dos-874" ];
+const aliases = [ "windows-874", "dos-874" ];
 
 function run_test() {
   testEncodeAliases();
 }
--- a/intl/uconv/tests/unit/test_encode_armscii.js
+++ b/intl/uconv/tests/unit/test_encode_armscii.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0587\u0589\u00bb\u00ab\u2014\u055d\u058a\u2026\u055c\u055b\u055e\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053a\u056a\u053b\u056b\u053c\u056c\u053d\u056d\u053e\u056e\u053f\u056f\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054a\u057a\u054b\u057b\u054c\u057c\u054d\u057d\u054e\u057e\u054f\u057f\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055a";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\xa2\xa3\xa6\xa7\xa8\xaa\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe";
 
 const aliases = ["armscii-8"];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_tcvn5712.js
+++ b/intl/uconv/tests/unit/test_encode_tcvn5712.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = "\u00da\u1ee4\u1eea\u1eec\u1eee\u1ee8\u1ef0\u1ef2\u1ef6\u1ef8\u00dd\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u00c1\u1ea0\u1eb6\u1eac\u00c8\u1eba\u1ebc\u00c9\u1eb8\u1ec6\u00cc\u1ec8\u0128\u00cd\u1eca\u00d2\u1ece\u00d5\u00d3\u1ecc\u1ed8\u1edc\u1ede\u1ee0\u1eda\u1ee2\u00d9\u1ee6\u0168\u00a0\u0102\u00c2\u00ca\u00d4\u01a0\u01af\u0110\u0103\u00e2\u00ea\u00f4\u01a1\u01b0\u0111\u1eb0\u0300\u0309\u0303\u0301\u0323\u00e0\u1ea3\u00e3\u00e1\u1ea1\u1eb2\u1eb1\u1eb3\u1eb5\u1eaf\u1eb4\u1eae\u1ea6\u1ea8\u1eaa\u1ea4\u1ec0\u1eb7\u1ea7\u1ea9\u1eab\u1ea5\u1ead\u00e8\u1ec2\u1ebb\u1ebd\u00e9\u1eb9\u1ec1\u1ec3\u1ec5\u1ebf\u1ec7\u00ec\u1ec9\u1ec4\u1ebe\u1ed2\u0129\u00ed\u1ecb\u00f2\u1ed4\u1ecf\u00f5\u00f3\u1ecd\u1ed3\u1ed5\u1ed7\u1ed1\u1ed9\u1edd\u1edf\u1ee1\u1edb\u1ee3\u00f9\u1ed6\u1ee7\u0169\u00fa\u1ee5\u1eeb\u1eed\u1eef\u1ee9\u1ef1\u1ef3\u1ef7\u1ef9\u00fd\u1ef5\u1ed0";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-viet-tcvn5712" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_viscii.js
+++ b/intl/uconv/tests/unit/test_encode_viscii.js
@@ -1,13 +1,14 @@
 // Tests conversion from Unicode to viscii
 
 load('CharsetConversionTests.js');
 	
 const inString = "\u1eb2\u1eb4\u1eaa\u1ef6\u1ef8\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u1ea0\u1eae\u1eb0\u1eb6\u1ea4\u1ea6\u1ea8\u1eac\u1ebc\u1eb8\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1ee2\u1eda\u1edc\u1ede\u1eca\u1ece\u1ecc\u1ec8\u1ee6\u0168\u1ee4\u1ef2\u00d5\u1eaf\u1eb1\u1eb7\u1ea5\u1ea7\u1ea9\u1ead\u1ebd\u1eb9\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ed1\u1ed3\u1ed5\u1ed7\u1ee0\u01a0\u1ed9\u1edd\u1edf\u1ecb\u1ef0\u1ee8\u1eea\u1eec\u01a1\u1edb\u01af\u00c0\u00c1\u00c2\u00c3\u1ea2\u0102\u1eb3\u1eb5\u00c8\u00c9\u00ca\u1eba\u00cc\u00cd\u0128\u1ef3\u0110\u1ee9\u00d2\u00d3\u00d4\u1ea1\u1ef7\u1eeb\u1eed\u00d9\u00da\u1ef9\u1ef5\u00dd\u1ee1\u01b0\u00e0\u00e1\u00e2\u00e3\u1ea3\u0103\u1eef\u1eab\u00e8\u00e9\u00ea\u1ebb\u00ec\u00ed\u0129\u1ec9\u0111\u1ef1\u00f2\u00f3\u00f4\u00f5\u1ecf\u1ecd\u1ee5\u00f9\u00fa\u0169\u1ee7\u00fd\u1ee3\u1eee";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
-const aliases = [ "VISCII", "viscii", "csviscii" ];
+//const aliases = [ "VISCII", "viscii", "csviscii" ];
+const aliases = [ "VISCII" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_vps.js
+++ b/intl/uconv/tests/unit/test_encode_vps.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = "\u1ea0\u1eac\u1eb6\u1eb8\u1ec6\u1eca\u1ecc\u1ed8\u1ee2\u1ee4\u1ef0\u1ef4\u1eaa\u1eee !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u1ea4\u1ea6\u1ea8\u1ecd\u1ed7\u0102\u1ebf\u1ec1\u1ec3\u1ec7\u1eae\u1eb0\u1eb2\u1ebe\u2018\u2019\u1ec0\u1ec2\u1ec4\u1ed0\u1ed2\u1ed4\u1ed6\u00fd\u1ef7\u1ef5\u1eda\u1edc\u1ede\u00a0\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1ee0\u1edb\u00d9\u1edd\u1edf\u1ee1\u0168\u1ee8\u1ee3\u1eea\u1ed5\u1eec\u1ef2\u1ef8\u00cd\u00cc\u1ed9\u1ec8\u0128\u00d3\u1eed\u1eef\u00d2\u1ece\u00d5\u1ef1\u1ea7\u00c1\u00c2\u1ea5\u1ea9\u1eab\u1ead\u0111\u1ebb\u00c9\u00ca\u1eb9\u1ec9\u1ec5\u1ecb\u1ef9\u01af\u1ee6\u1ed3\u1ed1\u00d4\u1ecf\u01a1\u00c8\u1eeb\u1ee9\u00da\u0169\u01b0\u00dd\u1eba\u00df\u00e0\u00e1\u00e2\u00e3\u1ea3\u1ea1\u0103\u00e7\u00e8\u00e9\u00ea\u1ebd\u00ec\u00ed\u00ee\u0129\u1eb4\u0110\u00f2\u00f3\u00f4\u00f5\u00f6\u01a0\u1ee5\u00f9\u00fa\u1ee7\u00fc\u1ef6\u1ebc\u1ef3";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-viet-vps" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_ce.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_ce.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u0100\u0101\u00c9\u0104\u00d6\u00dc\u00e1\u0105\u010c\u00e4\u010d\u0106\u0107\u00e9\u0179\u017a\u010e\u00ed\u010f\u0112\u0113\u0116\u00f3\u0117\u00f4\u00f6\u00f5\u00fa\u011a\u011b\u00fc\u2020\u00b0\u0118\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u0119\u00a8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\u00ac\u221a\u0144\u0147\u2206\u00ab\u00bb\u2026\u00a0\u0148\u0150\u00d5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\u00c1\u0164\u0165\u00cd\u017d\u017e\u016a\u00d3\u00d4\u016b\u016e\u00da\u016f\u0170\u0171\u0172\u0173\u00dd\u00fd\u0137\u017b\u0141\u017c\u0122\u02c7";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-mac-ce" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_croatian.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_croatian.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u0160\u2122\u00b4\u00a8\u2260\u017d\u00d8\u221e\u00b1\u2264\u2265\u2206\u00b5\u2202\u2211\u220f\u0161\u222b\u00aa\u00ba\u03a9\u017e\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u0106\u00ab\u010c\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\uf8ff\u00a9\u2044\u20ac\u2039\u203a\u00c6\u00bb\u2013\u00b7\u201a\u201e\u2030\u00c2\u0107\u00c1\u010d\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\u0111\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u03c0\u00cb\u02da\u00b8\u00ca\u00e6\u02c7";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-mac-croatian" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_devanagari.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_devanagari.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0970\u0901\u0902\u0903\u0905\u0906\u0907\u0908\u0909\u090a\u090b\u090e\u090f\u0910\u090d\u0912\u0913\u0914\u0911\u0915\u0916\u0917\u0918\u0919\u091a\u091b\u091c\u091d\u091e\u091f\u0920\u0921\u0922\u0923\u0924\u0925\u0926\u0927\u0928\u0929\u092a\u092b\u092c\u092d\u092e\u092f\u095f\u0930\u0931\u0932\u0933\u0934\u0935\u0936\u0937\u0938\u0939\u200e\u093e\u093f\u0940\u0941\u0942\u0943\u0946\u0947\u0948\u0945\u094a\u094b\u094c\u0949\u094d\u093c\u0964\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x90\x91\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa";
 
 const aliases = [ "x-mac-devanagari" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_greek.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_greek.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00b9\u00b2\u00c9\u00b3\u00d6\u00dc\u0385\u00e0\u00e2\u00e4\u0384\u00a8\u00e7\u00e9\u00e8\u00ea\u00eb\u00a3\u2122\u00ee\u00ef\u2022\u00bd\u2030\u00f4\u00f6\u00a6\u20ac\u00f9\u00fb\u00fc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\u00df\u00ae\u00a9\u03a3\u03aa\u00a7\u2260\u00b0\u00b7\u0391\u00b1\u2264\u2265\u00a5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\u00ac\u039f\u03a1\u2248\u03a4\u00ab\u00bb\u2026\u00a0\u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\u00f7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\u00ad";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-mac-greek" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_gujarati.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_gujarati.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0a81\u0a82\u0a83\u0a85\u0a86\u0a87\u0a88\u0a89\u0a8a\u0a8b\u0a8f\u0a90\u0a8d\u0a93\u0a94\u0a91\u0a95\u0a96\u0a97\u0a98\u0a99\u0a9a\u0a9b\u0a9c\u0a9d\u0a9e\u0a9f\u0aa0\u0aa1\u0aa2\u0aa3\u0aa4\u0aa5\u0aa6\u0aa7\u0aa8\u0aaa\u0aab\u0aac\u0aad\u0aae\u0aaf\u0ab0\u0ab2\u0ab3\u0ab5\u0ab6\u0ab7\u0ab8\u0ab9\u200e\u0abe\u0abf\u0ac0\u0ac1\u0ac2\u0ac3\u0ac7\u0ac8\u0ac5\u0acb\u0acc\u0ac9\u0acd\u0abc\u0964\u0ae6\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x90\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xac\xad\xae\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc8\xc9\xca\xcb\xcc\xcd\xcf\xd1\xd2\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe1\xe2\xe3\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa";
 
 const aliases = [ "x-mac-gujarati" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_gurmukhi.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_gurmukhi.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0a71\u0a5c\u0a73\u0a72\u0a74\u0a02\u0a05\u0a06\u0a07\u0a08\u0a09\u0a0a\u0a0f\u0a10\u0a13\u0a14\u0a15\u0a16\u0a17\u0a18\u0a19\u0a1a\u0a1b\u0a1c\u0a1d\u0a1e\u0a1f\u0a20\u0a21\u0a22\u0a23\u0a24\u0a25\u0a26\u0a27\u0a28\u0a2a\u0a2b\u0a2c\u0a2d\u0a2e\u0a2f\u0a30\u0a32\u0a35\uf860\u0a38\u0a39\u200e\u0a3e\u0a3f\u0a40\u0a41\u0a42\u0a47\u0a48\u0a4b\u0a4c\u0a4d\u0a3c\u0964\u0a66\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x90\x91\x92\x93\x94\xa2\xa4\xa5\xa6\xa7\xa8\xa9\xac\xad\xb0\xb1\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc8\xc9\xca\xcb\xcc\xcd\xcf\xd1\xd4\xd5\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xe1\xe2\xe5\xe6\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa";
 
 const aliases = [ "x-mac-gurmukhi" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_icelandic.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_icelandic.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u00dd\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u00d0\u00f0\u00de\u00fe\u00fd\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-mac-icelandic" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_romanian.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_romanian.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u0102\u0218\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u0103\u0219\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-mac-romanian" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
--- a/intl/uconv/tests/unit/test_encode_x_mac_turkish.js
+++ b/intl/uconv/tests/unit/test_encode_x_mac_turkish.js
@@ -4,10 +4,10 @@ load('CharsetConversionTests.js');
 	
 const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\uf8a0\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7";
     
 const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
 
 const aliases = [ "x-mac-turkish" ];
 
 function run_test() {
-  testEncodeAliases();
+  testEncodeAliasesInternal();
 }
deleted file mode 100644
--- a/intl/uconv/tests/unit/test_iso2022KR.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Test case for ISO-2022-KR
- *
- * Uses nsIConverterInputStream to decode ISO-2022-KR text.
- *
- * Sample text is: 
- * 1: 소 잃고 외양간 고친다
- * 2: 빈 수레가 요란하다
- * 3: 하늘의 별 따기
- * 4: 아는 길도 물어가라
- *
- * (From http://en.wikiquote.org/wiki/Korean_proverbs)
- */
-
-const sample = "%1B%24%29C1%3A%20%0E%3CR%0F%20%0E%40R0m%0F%20%0E%3F%5C%3Eg0%23%0F%20%0E0mD%234Y%0A2%3A%20%0E%3As%0F%20%0E%3Cv790%21%0F%20%0E%3Fd6uGO4Y%0A3%3A%20%0EGO4C%40G%0F%20%0E%3A0%0F%20%0E5%7B1b%0A4%3A%20%0E%3EF4B%0F%20%0E1f55%0F%20%0E90%3En0%216s";
-
-const expected = "1: \uC18C \uC783\uACE0 \uC678\uC591\uAC04 \uACE0\uCE5C\uB2E4\n2: \uBE48 \uC218\uB808\uAC00 \uC694\uB780\uD558\uB2E4\n3: \uD558\uB298\uC758 \uBCC4 \uB530\uAE30\n4: \uC544\uB294 \uAE38\uB3C4 \uBB3C\uC5B4\uAC00\uB77C\n"; 
-
-const charset="ISO-2022-KR";
-
-function testCase(bufferLength)
-{
-  var dataURI = "data:text/plain;charset=" + charset + "," + sample;
-
-  var IOService = Components.Constructor("@mozilla.org/network/io-service;1",
-					 "nsIIOService");
-  var ConverterInputStream =
-      Components.Constructor("@mozilla.org/intl/converter-input-stream;1",
-			     "nsIConverterInputStream",
-			     "init");
-
-  var ios = new IOService();
-  var channel = ios.newChannel(dataURI, "", null);
-  var testInputStream = channel.open();
-  var testConverter = new ConverterInputStream(testInputStream,
-					       charset,
-					       bufferLength,
-					       0xFFFD);
-
-  if (!(testConverter instanceof
-	Components.interfaces.nsIUnicharLineInputStream))
-      throw "not line input stream";
-
-  var outStr = "";
-  var more;
-  do {
-      // read the line and check for eof
-      var line = {};
-      more = testConverter.readLine(line);
-      outStr += line.value + "\n";
-  } while (more);
-
-  if (outStr != expected) {
-    dump("Failed with bufferLength = " + bufferLength + "\n");
-    if (outStr.length == expected.length) {
-      for (i = 0; i < outStr.length; ++i) {
-	if (outStr.charCodeAt(i) != expected.charCodeAt(i)) {
-	  dump(i + ": " + outStr.charCodeAt(i).toString(16) + " != " + expected.charCodeAt(i).toString(16) + "\n");
-	}
-      }
-    }
-  }
-
-  // escape the strings before comparing for better readability
-  do_check_eq(escape(outStr), escape(expected));
-}
-
-function run_test()
-{
-  testCase(34);
-  testCase(35);
-}
--- a/intl/uconv/tests/unit/xpcshell.ini
+++ b/intl/uconv/tests/unit/xpcshell.ini
@@ -16,31 +16,26 @@ support-files =
 [test_bug365345.js]
 [test_bug367026.js]
 [test_bug381412.Big5-HKSCS.js]
 [test_bug381412.Big5.js]
 [test_bug381412.euc-kr.js]
 [test_bug381412.euc_jp.js]
 [test_bug381412.gb2312.js]
 [test_bug381412.hk.gb2312.js]
-[test_bug381412.johab.js]
 [test_bug381412.js]
-[test_bug383018.js]
 [test_bug396637.js]
 [test_bug399257.js]
-[test_bug399284.js]
-[test_bug449578.js]
 [test_bug457886.js]
 [test_bug522931.js]
 [test_bug563283.js]
 [test_bug563618.js]
 [test_bug601429.js]
 [test_bug699673.js]
 [test_bug90411.js]
-[test_bug713519.js]
 [test_bug715319.euc_jp.js]
 [test_bug715319.gb2312.js]
 [test_bug715319.dbcs.js]
 [test_charset_conversion.js]
 [test_decode_8859-1.js]
 [test_decode_8859-10.js]
 [test_decode_8859-11.js]
 [test_decode_8859-13.js]
@@ -143,11 +138,10 @@ support-files =
 [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_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]
 [test_input_stream.js]
--- a/intl/uconv/ucvcn/nsISO2022CNToUnicode.cpp
+++ b/intl/uconv/ucvcn/nsISO2022CNToUnicode.cpp
@@ -1,56 +1,41 @@
 /* -*- Mode: C; tab-width: 4; 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 "nsISO2022CNToUnicode.h"
 #include "nsUCSupport.h"
-#include "nsICharsetConverterManager.h"
-#include "nsServiceManagerUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
 
-static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
+using mozilla::dom::EncodingUtils;
 
 NS_IMETHODIMP nsISO2022CNToUnicode::GB2312_To_Unicode(unsigned char *aSrc, int32_t aSrcLength, char16_t * aDest, int32_t * aDestLength)
 {
     nsresult rv;
 
     if(!mGB2312_Decoder) {
        // creating a delegate converter (GB2312)
-       nsCOMPtr<nsICharsetConverterManager> ccm =
-              do_GetService(kCharsetConverterManagerCID, &rv);
-       if(NS_FAILED(rv))
-          return NS_ERROR_UNEXPECTED;
-
-       rv = ccm->GetUnicodeDecoderRaw("GB2312", getter_AddRefs(mGB2312_Decoder));
-       if(NS_FAILED(rv))
-          return NS_ERROR_UNEXPECTED;
+       mGB2312_Decoder = EncodingUtils::DecoderForEncoding(NS_LITERAL_CSTRING("GB2312"));
     }
 
     if(!mGB2312_Decoder) // failed creating a delegate converter
        return NS_ERROR_UNEXPECTED;
 
     rv = mGB2312_Decoder->Convert((const char *)aSrc, &aSrcLength, aDest, aDestLength);
     return rv;
 }
 
 NS_IMETHODIMP nsISO2022CNToUnicode::EUCTW_To_Unicode(unsigned char *aSrc, int32_t aSrcLength, char16_t * aDest, int32_t * aDestLength)
 {
     nsresult rv;
 
     if(!mEUCTW_Decoder) {
        // creating a delegate converter (x-euc-tw)
-       nsCOMPtr<nsICharsetConverterManager> ccm =
-              do_GetService(kCharsetConverterManagerCID, &rv);
-       if(NS_FAILED(rv))
-          return NS_ERROR_UNEXPECTED;
-
-       rv = ccm->GetUnicodeDecoderRaw("x-euc-tw", getter_AddRefs(mEUCTW_Decoder));
-       if(NS_FAILED(rv))
-          return NS_ERROR_UNEXPECTED;
+       mEUCTW_Decoder = EncodingUtils::DecoderForEncoding(NS_LITERAL_CSTRING("x-euc-tw"));
     }
 
     if(!mEUCTW_Decoder) // failed creating a delegate converter
        return NS_ERROR_UNEXPECTED;
 
     rv = mEUCTW_Decoder->Convert((const char *)aSrc, &aSrcLength, aDest, aDestLength);
     return(rv);
 }
--- a/intl/uconv/ucvja/nsJapaneseToUnicode.cpp
+++ b/intl/uconv/ucvja/nsJapaneseToUnicode.cpp
@@ -3,20 +3,20 @@
  * 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 "nsJapaneseToUnicode.h"
 
 #include "nsUCSupport.h"
 
 #include "japanese.map"
 
-#include "nsICharsetConverterManager.h"
-#include "nsServiceManagerUtils.h"
+#include "mozilla/Assertions.h"
+#include "mozilla/dom/EncodingUtils.h"
 
-#include "mozilla/Assertions.h"
+using mozilla::dom::EncodingUtils;
 
 // HTML5 says to use Windows-31J instead of the real Shift_JIS for decoding
 #define SJIS_INDEX gCP932Index[0]
 #define JIS0208_INDEX gCP932Index[1]
 
 #define JIS0212_INDEX gJIS0212Index
 #define SJIS_UNMAPPED	0x30fb
 #define UNICODE_REPLACEMENT_CHARACTER 0xfffd
@@ -372,18 +372,16 @@ error1:
 }
 
 
 
 NS_IMETHODIMP nsISO2022JPToUnicodeV2::Convert(
    const char * aSrc, int32_t * aSrcLen,
      char16_t * aDest, int32_t * aDestLen)
 {
-   static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
-
    static const uint16_t fbIdx[128] =
    {
 /* 0x8X */
      0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
      0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
 /* 0x9X */
      0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
      0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
@@ -760,22 +758,18 @@ NS_IMETHODIMP nsISO2022JPToUnicodeV2::Co
             uint8_t off = sbIdx[*src];
             if(0xFF == off) {
               if (mErrBehavior == kOnError_Signal)
                 goto error3;
               *dest++ = UNICODE_REPLACEMENT_CHARACTER;
             } else {
               if (!mGB2312Decoder) {
                 // creating a delegate converter (GB2312)
-                nsresult rv;
-                nsCOMPtr<nsICharsetConverterManager> ccm = 
-                         do_GetService(kCharsetConverterManagerCID, &rv);
-                if (NS_SUCCEEDED(rv)) {
-                  rv = ccm->GetUnicodeDecoderRaw("GB2312", &mGB2312Decoder);
-                }
+                mGB2312Decoder =
+                  EncodingUtils::DecoderForEncoding(NS_LITERAL_CSTRING("GB2312"));
               }
               if (!mGB2312Decoder) {// failed creating a delegate converter
                 goto error2;
               } else {
                 unsigned char gb[2];
                 char16_t uni;
                 int32_t gbLen = 2, uniLen = 1;
                 // ((mData/94)+0x21) is the original 1st byte.
@@ -818,22 +812,18 @@ NS_IMETHODIMP nsISO2022JPToUnicodeV2::Co
             uint8_t off = sbIdx[*src];
             if(0xFF == off) {
               if (mErrBehavior == kOnError_Signal)
                 goto error3;
               *dest++ = UNICODE_REPLACEMENT_CHARACTER;
             } else {
               if (!mEUCKRDecoder) {
                 // creating a delegate converter (EUC-KR)
-                nsresult rv;
-                nsCOMPtr<nsICharsetConverterManager> ccm = 
-                         do_GetService(kCharsetConverterManagerCID, &rv);
-                if (NS_SUCCEEDED(rv)) {
-                  rv = ccm->GetUnicodeDecoderRaw("EUC-KR", &mEUCKRDecoder);
-                }
+                mEUCKRDecoder =
+                  EncodingUtils::DecoderForEncoding(NS_LITERAL_CSTRING("EUC-KR"));
               }
               if (!mEUCKRDecoder) {// failed creating a delegate converter
                 goto error2;
               } else {              
                 unsigned char ksc[2];
                 char16_t uni;
                 int32_t kscLen = 2, uniLen = 1;
                 // ((mData/94)+0x21) is the original 1st byte.
@@ -899,22 +889,18 @@ NS_IMETHODIMP nsISO2022JPToUnicodeV2::Co
             if((0x20 <= *src) && (*src <= 0x7F)) {
               if (CHECK_OVERRUN(dest, destEnd, 1))
                 goto error1;
               if (G2_ISO88591 == G2charset) {
                 *dest++ = *src | 0x80;
               } else if (G2_ISO88597 == G2charset) {
                 if (!mISO88597Decoder) {
                   // creating a delegate converter (ISO-8859-7)
-                  nsresult rv;
-                  nsCOMPtr<nsICharsetConverterManager> ccm = 
-                           do_GetService(kCharsetConverterManagerCID, &rv);
-                  if (NS_SUCCEEDED(rv)) {
-                    rv = ccm->GetUnicodeDecoderRaw("ISO-8859-7", &mISO88597Decoder);
-                  }
+                  mISO88597Decoder =
+                    EncodingUtils::DecoderForEncoding(NS_LITERAL_CSTRING("ISO-8859-7"));
                 }
                 if (!mISO88597Decoder) {// failed creating a delegate converter
                   goto error2;
                 } else {
                   // Put one character with ISO-8859-7 encoding.
                   unsigned char gr = *src | 0x80;
                   char16_t uni;
                   int32_t grLen = 1, uniLen = 1;
--- a/intl/uconv/ucvja/nsJapaneseToUnicode.h
+++ b/intl/uconv/ucvja/nsJapaneseToUnicode.h
@@ -83,19 +83,16 @@ public:
         mGB2312Decoder = nullptr;
         mEUCKRDecoder = nullptr;
         mISO88597Decoder = nullptr;
         mozilla::Telemetry::Accumulate(
           mozilla::Telemetry::DECODER_INSTANTIATED_ISO2022JP, true);
      }
  virtual ~nsISO2022JPToUnicodeV2()
      {
-        NS_IF_RELEASE(mGB2312Decoder);
-        NS_IF_RELEASE(mEUCKRDecoder);
-        NS_IF_RELEASE(mISO88597Decoder);
      }
 
  NS_IMETHOD Convert(const char * aSrc, int32_t * aSrcLength,
      char16_t * aDest, int32_t * aDestLength) ;
  NS_IMETHOD GetMaxLength(const char * aSrc, int32_t aSrcLength,
      int32_t * aDestLength) 
      {
         *aDestLength = aSrcLength;
@@ -134,13 +131,13 @@ private:
  } mState, mLastLegalState;
  int32_t mData;
  int32_t mRunLength; // the length of a non-ASCII run
  enum {
    G2_unknown,
    G2_ISO88591,
    G2_ISO88597
  } G2charset;
- nsIUnicodeDecoder *mGB2312Decoder;
- nsIUnicodeDecoder *mEUCKRDecoder;
- nsIUnicodeDecoder *mISO88597Decoder;
+ nsCOMPtr<nsIUnicodeDecoder> mGB2312Decoder;
+ nsCOMPtr<nsIUnicodeDecoder> mEUCKRDecoder;
+ nsCOMPtr<nsIUnicodeDecoder> mISO88597Decoder;
 };
 #endif // nsShiftJISToUnicode_h__
--- a/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp
+++ b/intl/uconv/ucvko/nsISO2022KRToUnicode.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C; tab-width: 4; 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 "nsISO2022KRToUnicode.h"
 #include "nsUCSupport.h"
-#include "nsICharsetConverterManager.h"
-#include "nsServiceManagerUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 NS_IMETHODIMP nsISO2022KRToUnicode::Convert(const char * aSrc, int32_t * aSrcLen, char16_t * aDest, int32_t * aDestLen)
 {
-  static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
-
   const unsigned char* srcEnd = (unsigned char*)aSrc + *aSrcLen;
   const unsigned char* src =(unsigned char*) aSrc;
   char16_t* destEnd = aDest + *aDestLen;
   char16_t* dest = aDest;
   while((src < srcEnd))
   {
     // if LF/CR, return to US-ASCII unconditionally.
     if ( *src == 0x0a || *src == 0x0d )
@@ -121,22 +120,18 @@ NS_IMETHODIMP nsISO2022KRToUnicode::Conv
           *dest++ = 0xFFFD;
         }
         break;
 
       case mState_KSX1001_1992_2ndbyte:
         if ( 0x20 < (uint8_t) *src && (uint8_t) *src < 0x7f  ) {
           if (!mEUCKRDecoder) {
             // creating a delegate converter (EUC-KR)
-            nsresult rv;
-            nsCOMPtr<nsICharsetConverterManager> ccm = 
-                  do_GetService(kCharsetConverterManagerCID, &rv);
-            if (NS_SUCCEEDED(rv)) {
-              rv = ccm->GetUnicodeDecoderRaw("EUC-KR", &mEUCKRDecoder);
-            }
+            mEUCKRDecoder =
+              EncodingUtils::DecoderForEncoding(NS_LITERAL_CSTRING("EUC-KR"));
           }
 
           if (!mEUCKRDecoder) {// failed creating a delegate converter
            *dest++ = 0xFFFD;
           } 
           else {              
             if (CHECK_OVERRUN(dest, destEnd, 1))
               goto error1;
--- a/intl/uconv/ucvko/nsISO2022KRToUnicode.h
+++ b/intl/uconv/ucvko/nsISO2022KRToUnicode.h
@@ -18,17 +18,16 @@ public:
     mEUCKRDecoder = nullptr;
     mRunLength = 0;
     mozilla::Telemetry::Accumulate(
       mozilla::Telemetry::DECODER_INSTANTIATED_ISO2022KR, true);
   }
 
   virtual ~nsISO2022KRToUnicode()
   {
-    NS_IF_RELEASE(mEUCKRDecoder);
   }
 
   NS_IMETHOD Convert(const char * aSrc, int32_t * aSrcLength,
      char16_t * aDest, int32_t * aDestLength) ;
   
   NS_IMETHOD GetMaxLength(const char * aSrc, int32_t aSrcLength,
      int32_t * aDestLength) 
   {
@@ -56,11 +55,11 @@ private:
     mState_ERROR
   } mState, mLastLegalState;
 
   uint8_t mData;
 
   // Length of non-ASCII run
   uint32_t mRunLength;
 
-  nsIUnicodeDecoder *mEUCKRDecoder;
+  nsCOMPtr<nsIUnicodeDecoder> mEUCKRDecoder;
 };
 #endif // nsISO2022KRToUnicode_h__
--- a/intl/unicharutil/src/nsSaveAsCharset.cpp
+++ b/intl/unicharutil/src/nsSaveAsCharset.cpp
@@ -2,20 +2,23 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "prmem.h"
 #include "prprf.h"
-#include "nsICharsetConverterManager.h"
 #include "nsSaveAsCharset.h"
 #include "nsWhitespaceTokenizer.h"
-#include "nsServiceManagerUtils.h"
+#include "nsIUnicodeEncoder.h"
+#include "mozilla/dom/EncodingUtils.h"
+#include "nsComponentManagerUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 //
 // nsISupports methods
 //
 NS_IMPL_ISUPPORTS(nsSaveAsCharset, nsISaveAsCharset)
 
 //
 // nsSaveAsCharset
@@ -320,23 +323,29 @@ nsSaveAsCharset::DoConversionFallBack(ui
   }
 
 	return rv;
 }
 
 nsresult nsSaveAsCharset::SetupUnicodeEncoder(const char* charset)
 {
   NS_ENSURE_ARG(charset);
-  nsresult rv;
-
-  // set up unicode encoder
-  nsCOMPtr <nsICharsetConverterManager> ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return ccm->GetUnicodeEncoder(charset, getter_AddRefs(mEncoder));
+  nsDependentCString label(charset);
+  if (label.EqualsLiteral("replacement")) {
+    // Internal caller. "replacement" doesn't survive another label resolution.
+    mEncoder = EncodingUtils::EncoderForEncoding(label);
+    return NS_OK;
+  }
+  nsAutoCString encoding;
+  if (!EncodingUtils::FindEncodingForLabelNoReplacement(label,
+                                                        encoding)) {
+    return NS_ERROR_UCONV_NOCONV;
+  }
+  mEncoder = EncodingUtils::EncoderForEncoding(encoding);
+  return NS_OK;
 }
 
 nsresult nsSaveAsCharset::SetupCharsetList(const char *charsetList)
 {
   NS_ENSURE_ARG(charsetList);
 
   NS_ASSERTION(charsetList[0], "charsetList should not be empty");
   if (!charsetList[0])
--- a/intl/unicharutil/src/nsSaveAsCharset.h
+++ b/intl/unicharutil/src/nsSaveAsCharset.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsSaveAsCharset_h__
 #define nsSaveAsCharset_h__
 
 #include "nsStringFwd.h"
 #include "nsTArray.h"
 #include "nsISaveAsCharset.h"
-
+#include "nsCOMPtr.h"
 
 #define MASK_FALLBACK(a) (nsISaveAsCharset::mask_Fallback & (a))
 #define MASK_ENTITY(a) (nsISaveAsCharset::mask_Entity & (a))
 #define MASK_CHARSET_FALLBACK(a) (nsISaveAsCharset::mask_CharsetFallback & (a))
 #define ATTR_NO_FALLBACK(a) (nsISaveAsCharset::attr_FallbackNone == MASK_FALLBACK(a) && \
                              nsISaveAsCharset::attr_EntityAfterCharsetConv != MASK_ENTITY(a))
 
 class nsIUnicodeEncoder;
--- a/js/xpconnect/src/XPCLocale.cpp
+++ b/js/xpconnect/src/XPCLocale.cpp
@@ -5,27 +5,29 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Assertions.h"
 
 #include "jsapi.h"
 
 #include "nsCollationCID.h"
 #include "nsJSUtils.h"
-#include "nsICharsetConverterManager.h"
 #include "nsIPlatformCharset.h"
 #include "nsILocaleService.h"
 #include "nsICollation.h"
 #include "nsUnicharUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
+#include "mozilla/dom/EncodingUtils.h"
+#include "nsIUnicodeDecoder.h"
 
 #include "xpcpublic.h"
 
 using namespace JS;
+using mozilla::dom::EncodingUtils;
 
 /**
  * JS locale callbacks implemented by XPCOM modules.  These are theoretically
  * safe for use on multiple threads.  Unfortunately, the intl code underlying
  * these XPCOM modules doesn't yet support this, so in practice
  * XPCLocaleCallbacks are limited to the main thread.
  */
 struct XPCLocaleCallbacks : public JSLocaleCallbacks
@@ -185,21 +187,17 @@ private:
 
           nsCOMPtr<nsIPlatformCharset> platformCharset =
             do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
 
           if (NS_SUCCEEDED(rv)) {
             nsAutoCString charset;
             rv = platformCharset->GetDefaultCharsetForLocale(localeStr, charset);
             if (NS_SUCCEEDED(rv)) {
-              // get/create unicode decoder for charset
-              nsCOMPtr<nsICharsetConverterManager> ccm =
-                do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-              if (NS_SUCCEEDED(rv))
-                ccm->GetUnicodeDecoder(charset.get(), getter_AddRefs(mDecoder));
+              mDecoder = EncodingUtils::DecoderForEncoding(charset);
             }
           }
         }
       }
     }
 
     int32_t srcLength = strlen(src);
 
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1144,17 +1144,17 @@ nsPresContext::DoChangeCharSet(const nsC
   mDeviceContext->FlushFontCache();
   RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
 }
 
 void
 nsPresContext::UpdateCharSet(const nsCString& aCharSet)
 {
   if (mLangService) {
-    mLanguage = mLangService->LookupCharSet(aCharSet.get());
+    mLanguage = mLangService->LookupCharSet(aCharSet);
     // this will be a language group (or script) code rather than a true language code
 
     // bug 39570: moved from nsLanguageAtomService::LookupCharSet()
     if (mLanguage == nsGkAtoms::Unicode) {
       mLanguage = mLangService->GetLocaleLanguage();
     }
     ResetCachedFontPrefs();
   }
--- a/layout/base/tests/test_bug399284.html
+++ b/layout/base/tests/test_bug399284.html
@@ -13,46 +13,75 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 /** Test for Bug 399284 **/
 const testContent = "<p id='testPara'>The quick brown fox jumps over the lazy dog";
 
-const Ci = SpecialPowers.Ci;
-const Cc = SpecialPowers.Cc;
-var ccManager = Cc["@mozilla.org/charset-converter-manager;1"].getService(Ci.nsICharsetConverterManager);
+var decoders = [
+    "Big5",
+    "Big5-HKSCS",
+    "EUC-JP",
+    "EUC-KR",
+    "gb18030",
+    "IBM866",
+    "ISO-2022-JP",
+    "ISO-8859-3",
+    "ISO-8859-4",
+    "ISO-8859-5",
+    "ISO-8859-6",
+    "ISO-8859-7",
+    "ISO-8859-8",
+    "ISO-8859-8-I",
+    "ISO-8859-10",
+    "ISO-8859-13",
+    "ISO-8859-14",
+    "ISO-8859-15",
+    "ISO-8859-16",
+    "ISO-8859-2",
+    "KOI8-R",
+    "KOI8-U",
+    "Shift_JIS",
+    "windows-1250",
+    "windows-1251",
+    "windows-1252",
+    "windows-1253",
+    "windows-1254",
+    "windows-1255",
+    "windows-1256",
+    "windows-1257",
+    "windows-1258",
+    "windows-874",
+    "x-mac-cyrillic",
+    "UTF-8",
+    "UTF-16LE",
+    "UTF-16BE"
+];
 
-var decoderList = ccManager.getDecoderList();
-SimpleTest.waitForExplicitFinish();
-while (decoderList.hasMore()) {
-    var decoder =  decoderList.getNext();
-
+var decoder;
+for (var i = 0; i < decoders.length; i++) {
+    var decoder = decoders[i];
+    var data;
+    
     // encode the content for non-ASCII compatible encodings
     if (decoder == "UTF-16BE")
         data = encodeUTF16BE(testContent);
-    else if (decoder == "UTF-16" || decoder == "UTF-16LE")
+    else if (decoder == "UTF-16LE")
         data = encodeUTF16LE(testContent);
-    else if (decoder == "replacement" || 
-             decoder == "ISO-2022-KR" || 
-             decoder == "ISO-2022-CN")
-        continue;
     else
         data = encodeURI(testContent);
     var dataURI = "data:text/html;charset=" + decoder + "," + data;
    
     var testFrame = document.createElement("iframe");
     frameID = decoder;
     testFrame.setAttribute("id", frameID);
     var testFrameObj = document.body.appendChild(testFrame);
-    if (decoderList.hasMore())
-        testFrameObj.setAttribute("onload", "testFontSize('" + decoder + "')");
-    else
-        testFrameObj.setAttribute("onload", "lastTest('" + decoder + "')");
+    testFrameObj.setAttribute("onload", "testFontSize('" + decoder + "')");
     testFrameObj.contentDocument.location.assign(dataURI);
 }
 
 function encodeUTF16BE(string)
 {
     var encodedString = "";
     for (i = 0; i < string.length; ++i) {
         encodedString += "%00";
@@ -66,22 +95,16 @@ function encodeUTF16LE(string)
     var encodedString = "";
     for (i = 0; i < string.length; ++i) {
         encodedString += encodeURI(string.charAt(i));
         encodedString += "%00";
     }
     return encodedString;
 }
 
-function lastTest(frame)
-{
-    testFontSize(frame);
-    SimpleTest.finish();
-}
-
 function testFontSize(frame)
 {
     var iframeDoc = $(frame).contentDocument;
     var size = parseInt(iframeDoc.defaultView.
                 getComputedStyle(iframeDoc.getElementById("testPara"), 
                                  null).
                 getPropertyValue("font-size"));
     ok(size > 0, "font size assigned for " + frame);
--- a/netwerk/base/src/nsStandardURL.cpp
+++ b/netwerk/base/src/nsStandardURL.cpp
@@ -7,36 +7,36 @@
 #include "IPCMessageUtils.h"
 
 #include "nsStandardURL.h"
 #include "nsCRT.h"
 #include "nsEscape.h"
 #include "nsIFile.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
-#include "nsICharsetConverterManager.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIIDNService.h"
 #include "prlog.h"
 #include "nsAutoPtr.h"
 #include "nsIProgrammingLanguage.h"
 #include "nsIURLParser.h"
 #include "nsNetCID.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ipc/URIUtils.h"
 #include <algorithm>
-
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 using namespace mozilla::ipc;
 
 static NS_DEFINE_CID(kThisImplCID, NS_THIS_STANDARDURL_IMPL_CID);
 static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
 
 nsIIDNService *nsStandardURL::gIDN = nullptr;
-nsICharsetConverterManager *nsStandardURL::gCharsetMgr = nullptr;
 bool nsStandardURL::gInitialized = false;
 bool nsStandardURL::gEscapeUTF8 = true;
 bool nsStandardURL::gAlwaysEncodeInUTF8 = true;
 
 #if defined(PR_LOGGING)
 //
 // setenv NSPR_LOG_MODULES nsStandardURL:5
 //
@@ -207,33 +207,27 @@ nsSegmentEncoder::EncodeSegment(const ns
         return result;
     return str;
 }
 
 bool nsStandardURL::
 nsSegmentEncoder::InitUnicodeEncoder()
 {
     NS_ASSERTION(!mEncoder, "Don't call this if we have an encoder already!");
-    nsresult rv;
-    if (!gCharsetMgr) {
-        rv = CallGetService("@mozilla.org/charset-converter-manager;1",
-                            &gCharsetMgr);
-        if (NS_FAILED(rv)) {
-            NS_ERROR("failed to get charset-converter-manager");
-            return false;
-        }
+    // "replacement" won't survive another label resolution
+    nsDependentCString label(mCharset);
+    if (label.EqualsLiteral("replacement")) {
+      mEncoder = EncodingUtils::EncoderForEncoding(label);
+      return true;
     }
-
-    rv = gCharsetMgr->GetUnicodeEncoder(mCharset, getter_AddRefs(mEncoder));
-    if (NS_FAILED(rv)) {
-        NS_ERROR("failed to get unicode encoder");
-        mEncoder = 0; // just in case
-        return false;
+    nsAutoCString encoding;
+    if (!EncodingUtils::FindEncodingForLabelNoReplacement(label, encoding)) {
+      return false;
     }
-
+    mEncoder = EncodingUtils::EncoderForEncoding(encoding);
     return true;
 }
 
 #define GET_SEGMENT_ENCODER_INTERNAL(name, useUTF8) \
     nsSegmentEncoder name(useUTF8 ? nullptr : mOriginCharset.get())
 
 #define GET_SEGMENT_ENCODER(name) \
     GET_SEGMENT_ENCODER_INTERNAL(name, gAlwaysEncodeInUTF8)
@@ -325,17 +319,16 @@ nsStandardURL::InitGlobalObjects()
     PR_INIT_CLIST(&gAllURLs);
 #endif
 }
 
 void
 nsStandardURL::ShutdownGlobalObjects()
 {
     NS_IF_RELEASE(gIDN);
-    NS_IF_RELEASE(gCharsetMgr);
 
 #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN
     if (gInitialized) {
         // This instanciates a dummy class, and will trigger the class
         // destructor when libxul is unloaded. This is equivalent to atexit(),
         // but gracefully handles dlclose().
         static DumpLeakedURLs d;
     }
--- a/netwerk/base/src/nsStandardURL.h
+++ b/netwerk/base/src/nsStandardURL.h
@@ -23,17 +23,16 @@
 
 #ifdef NS_BUILD_REFCNT_LOGGING
 #define DEBUG_DUMP_URLS_AT_SHUTDOWN
 #endif
 
 class nsIBinaryInputStream;
 class nsIBinaryOutputStream;
 class nsIIDNService;
-class nsICharsetConverterManager;
 class nsIPrefBranch;
 class nsIFile;
 class nsIURLParser;
 
 //-----------------------------------------------------------------------------
 // standard URL implementation
 //-----------------------------------------------------------------------------
 
@@ -266,17 +265,16 @@ private:
     uint32_t mSpecEncoding    : 2; // eEncoding_xxx
     uint32_t mURLType         : 2; // nsIStandardURL::URLTYPE_xxx
     uint32_t mMutable         : 1; // nsIStandardURL::mutable
     uint32_t mSupportsFileURL : 1; // QI to nsIFileURL?
 
     // global objects.  don't use COMPtr as its destructor will cause a
     // coredump if we leak it.
     static nsIIDNService               *gIDN;
-    static nsICharsetConverterManager  *gCharsetMgr;
     static bool                         gInitialized;
     static bool                         gEscapeUTF8;
     static bool                         gAlwaysEncodeInUTF8;
     static bool                         gEncodeQueryInUTF8;
 
 public:
 #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN
     PRCList mDebugCList;
--- a/netwerk/base/src/nsUnicharStreamLoader.cpp
+++ b/netwerk/base/src/nsUnicharStreamLoader.cpp
@@ -2,27 +2,27 @@
 /* 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 "mozilla/DebugOnly.h"
 
 #include "nsUnicharStreamLoader.h"
 #include "nsIInputStream.h"
-#include "nsICharsetConverterManager.h"
-#include "nsServiceManagerUtils.h"
 #include <algorithm>
+#include "mozilla/dom/EncodingUtils.h"
 
 // 1024 bytes is specified in
 // http://www.whatwg.org/specs/web-apps/current-work/#charset for HTML; for
 // other resource types (e.g. CSS) typically fewer bytes are fine too, since
 // they only look at things right at the beginning of the data.
 #define SNIFFING_BUFFER_SIZE 1024
 
 using namespace mozilla;
+using mozilla::dom::EncodingUtils;
 
 NS_IMETHODIMP
 nsUnicharStreamLoader::Init(nsIUnicharStreamLoaderObserver *aObserver)
 {
   NS_ENSURE_ARG_POINTER(aObserver);
 
   mObserver = aObserver;
 
@@ -157,46 +157,41 @@ nsUnicharStreamLoader::OnDataAvailable(n
     }
   }
 
   mContext = nullptr;
   mChannel = nullptr;
   return rv;
 }
 
-/* internal */
-static NS_DEFINE_CID(kCharsetConverterManagerCID,
-                     NS_ICHARSETCONVERTERMANAGER_CID);
-
 nsresult
 nsUnicharStreamLoader::DetermineCharset()
 {
   nsresult rv = mObserver->OnDetermineCharset(this, mContext,
                                               mRawData, mCharset);
   if (NS_FAILED(rv) || mCharset.IsEmpty()) {
     // The observer told us nothing useful
     mCharset.AssignLiteral("UTF-8");
   }
 
-  // Create the decoder for this character set
-  nsCOMPtr<nsICharsetConverterManager> ccm =
-    do_GetService(kCharsetConverterManagerCID, &rv);
-  if (NS_FAILED(rv)) return rv;
-
   // Sadly, nsIUnicharStreamLoader is exposed to extensions, so we can't
-  // assume mozilla::css::Loader to be the only caller. Since legacy
-  // charset alias code doesn't know about the replacement encoding,
-  // special-case it here, but let other stuff go through legacy alias
-  // resolution for now.
+  // assume mozilla::css::Loader to be the only caller. Special-casing
+  // replacement, since it's not invariant under a second label resolution
+  // operation.
   if (mCharset.EqualsLiteral("replacement")) {
-    rv = ccm->GetUnicodeDecoderRaw(mCharset.get(), getter_AddRefs(mDecoder));
+    mDecoder = EncodingUtils::DecoderForEncoding(mCharset);
   } else {
-    rv = ccm->GetUnicodeDecoder(mCharset.get(), getter_AddRefs(mDecoder));
+    nsAutoCString charset;
+    if (!EncodingUtils::FindEncodingForLabelNoReplacement(mCharset, charset)) {
+      // If we got replacement here, the caller was not mozilla::css::Loader
+      // but an extension.
+      return NS_ERROR_UCONV_NOCONV;
+    }
+    mDecoder = EncodingUtils::DecoderForEncoding(charset);
   }
-  if (NS_FAILED(rv)) return rv;
 
   // Process the data into mBuffer
   uint32_t dummy;
   rv = WriteSegmentFun(nullptr, this,
                        mRawData.BeginReading(),
                        0, mRawData.Length(),
                        &dummy);
   mRawData.Truncate();
--- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp
+++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp
@@ -13,17 +13,16 @@
 #include "nsIDirIndex.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsURLHelper.h"
 #include "nsIPlatformCharset.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsIChromeRegistry.h"
-#include "nsICharsetConverterManager.h"
 #include "nsIDateTimeFormat.h"
 #include "nsIStringBundle.h"
 #include "nsITextToSubURI.h"
 #include "nsXPIDLString.h"
 #include <algorithm>
 
 NS_IMPL_ISUPPORTS(nsIndexedToHTML,
                   nsIDirIndexListener,
--- a/netwerk/streamconv/converters/nsIndexedToHTML.h
+++ b/netwerk/streamconv/converters/nsIndexedToHTML.h
@@ -12,17 +12,16 @@
 #include "nsIDirIndexListener.h"
 
 #define NS_NSINDEXEDTOHTMLCONVERTER_CID \
 { 0xcf0f71fd, 0xfafd, 0x4e2b, {0x9f, 0xdc, 0x13, 0x4d, 0x97, 0x2e, 0x16, 0xe2} }
 
 class nsIDateTimeFormat;
 class nsIStringBundle;
 class nsITextToSubURI;
-class nsIUnicodeEncoder;
 
 class nsIndexedToHTML : public nsIStreamConverter,
                         public nsIDirIndexListener
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISTREAMCONVERTER
     NS_DECL_NSIREQUESTOBSERVER
@@ -48,17 +47,16 @@ protected:
 protected:
     nsCOMPtr<nsIDirIndexParser>     mParser;
     nsCOMPtr<nsIStreamListener>     mListener; // final listener (consumer)
 
     nsCOMPtr<nsIDateTimeFormat> mDateTime;
     nsCOMPtr<nsIStringBundle> mBundle;
 
     nsCOMPtr<nsITextToSubURI> mTextToSubURI;
-    nsCOMPtr<nsIUnicodeEncoder> mUnicodeEncoder;
 
 private:
     // Expecting absolute locations, given by 201 lines.
     bool mExpectAbsLoc;
 };
 
 #endif
 
--- a/netwerk/test/unit/test_gre_resources.js
+++ b/netwerk/test/unit/test_gre_resources.js
@@ -17,11 +17,11 @@ function check_file(file) {
     let instr = wrapInputStream(channel.open());
     do_check_true(instr.read(1024).length > 0)
   } catch (e) {
     do_throw("Failed to read " + file + " from gre-resources:"+e)
   }
 }
 
 function run_test() {
-  for each(let file in ["charsetData.properties"])
+  for each(let file in ["ua.css"])
     check_file(file)
 }
--- a/parser/html/nsHtml5StreamParser.cpp
+++ b/parser/html/nsHtml5StreamParser.cpp
@@ -229,21 +229,18 @@ nsHtml5StreamParser::GetChannel(nsIChann
 
 NS_IMETHODIMP
 nsHtml5StreamParser::Notify(const char* aCharset, nsDetectionConfident aConf)
 {
   NS_ASSERTION(IsParserThread(), "Wrong thread!");
   if (aConf == eBestAnswer || aConf == eSureAnswer) {
     mFeedChardet = false; // just in case
     nsAutoCString encoding;
-    if (!EncodingUtils::FindEncodingForLabel(nsDependentCString(aCharset),
-                                             encoding)) {
-      return NS_OK;
-    }
-    if (encoding.EqualsLiteral("replacement")) {
+    if (!EncodingUtils::FindEncodingForLabelNoReplacement(
+        nsDependentCString(aCharset), encoding)) {
       return NS_OK;
     }
     if (HasDecoder()) {
       if (mCharset.Equals(encoding)) {
         NS_ASSERTION(mCharsetSource < kCharsetFromAutoDetection,
             "Why are we running chardet at all?");
         mCharsetSource = kCharsetFromAutoDetection;
         mTreeBuilder->SetDocumentCharset(mCharset, mCharsetSource);
--- a/widget/gtk/nsClipboard.cpp
+++ b/widget/gtk/nsClipboard.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/ArrayUtils.h"
 
 #include "nsClipboard.h"
 #include "nsSupportsPrimitives.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsXPIDLString.h"
 #include "nsPrimitiveHelpers.h"
-#include "nsICharsetConverterManager.h"
 #include "nsIServiceManager.h"
 #include "nsImageToPixbuf.h"
 #include "nsStringStream.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/TimeStamp.h"
 
@@ -29,16 +28,20 @@
 // For manipulation of the X event queue
 #include <X11/Xlib.h>
 #include <gdk/gdkx.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <unistd.h>
 
+#include "mozilla/dom/EncodingUtils.h"
+#include "nsIUnicodeDecoder.h"
+
+using mozilla::dom::EncodingUtils;
 using namespace mozilla;
 
 // Callback when someone asks us for the data
 void
 clipboard_get_cb(GtkClipboard *aGtkClipboard,
                  GtkSelectionData *aSelectionData,
                  guint info,
                  gpointer user_data);
@@ -703,35 +706,27 @@ void ConvertHTMLtoUCS2(guchar * data, in
             (*unicodeData)[outUnicodeLen] = '\0';
         }
     } else if (charset.EqualsLiteral("UNKNOWN")) {
         outUnicodeLen = 0;
         return;
     } else {
         // app which use "text/html" to copy&paste
         nsCOMPtr<nsIUnicodeDecoder> decoder;
-        nsresult rv;
         // get the decoder
-        nsCOMPtr<nsICharsetConverterManager> ccm =
-            do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
-        if (NS_FAILED(rv)) {
-#ifdef DEBUG_CLIPBOARD
-            g_print("        can't get CHARSET CONVERTER MANAGER service\n");
-#endif
-            outUnicodeLen = 0;
-            return;
-        }
-        rv = ccm->GetUnicodeDecoder(charset.get(), getter_AddRefs(decoder));
-        if (NS_FAILED(rv)) {
+        nsAutoCString encoding;
+        if (!EncodingUtils::FindEncodingForLabelNoReplacement(charset,
+                                                              encoding)) {
 #ifdef DEBUG_CLIPBOARD
             g_print("        get unicode decoder error\n");
 #endif
             outUnicodeLen = 0;
             return;
         }
+        decoder = EncodingUtils::DecoderForEncoding(encoding);
         // converting
         decoder->GetMaxLength((const char *)data, dataLength, &outUnicodeLen);
         // |outUnicodeLen| is number of chars
         if (outUnicodeLen) {
             *unicodeData = reinterpret_cast<char16_t*>
                                            (nsMemory::Alloc((outUnicodeLen + sizeof('\0')) *
                            sizeof(char16_t)));
             if (*unicodeData) {
--- a/widget/xpwidgets/nsPrimitiveHelpers.cpp
+++ b/widget/xpwidgets/nsPrimitiveHelpers.cpp
@@ -25,22 +25,25 @@
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsITransferable.h"
 #include "nsIComponentManager.h"
 #include "nsLinebreakConverter.h"
 #include "nsReadableUtils.h"
 
 #include "nsIServiceManager.h"
-#include "nsICharsetConverterManager.h"
 // unicode conversion
-#  include "nsIPlatformCharset.h"
+#include "nsIPlatformCharset.h"
+#include "nsIUnicodeDecoder.h"
 #include "nsISaveAsCharset.h"
 #include "nsAutoPtr.h"
 #include "mozilla/Likely.h"
+#include "mozilla/dom/EncodingUtils.h"
+
+using mozilla::dom::EncodingUtils;
 
 
 //
 // CreatePrimitiveForData
 //
 // Given some data and the flavor it corresponds to, creates the appropriate
 // nsISupports* wrapper for passing across IDL boundaries. Right now, everything
 // creates a two-byte |nsISupportsString|, except for "text/plain" and native
@@ -191,27 +194,19 @@ nsPrimitiveHelpers :: ConvertPlatformPla
   static bool hasConverter = false;
   if ( !hasConverter ) {
     // get the charset
     nsAutoCString platformCharset;
     nsCOMPtr <nsIPlatformCharset> platformCharsetService = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
     if (NS_SUCCEEDED(rv))
       rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset);
     if (NS_FAILED(rv))
-      platformCharset.AssignLiteral("ISO-8859-1");
+      platformCharset.AssignLiteral("windows-1252");
       
-    // get the decoder
-    nsCOMPtr<nsICharsetConverterManager> ccm = 
-             do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);  
-    rv = ccm->GetUnicodeDecoderRaw(platformCharset.get(),
-                                   getter_AddRefs(decoder));
-
-    NS_ASSERTION(NS_SUCCEEDED(rv), "GetUnicodeEncoderRaw failed.");
-    if (NS_FAILED(rv))
-      return NS_ERROR_FAILURE;
+    decoder = EncodingUtils::DecoderForEncoding(platformCharset);
 
     hasConverter = true;
   }
   
   // Estimate out length and allocate the buffer based on a worst-case estimate, then do
   // the conversion. 
   decoder->GetMaxLength(inText, inTextLen, outUnicodeLen);   // |outUnicodeLen| is number of chars
   if ( *outUnicodeLen ) {