diff options
Diffstat (limited to 'intl')
40 files changed, 8 insertions, 1355 deletions
diff --git a/intl/build/nsI18nModule.cpp b/intl/build/nsI18nModule.cpp index b71d96902..66623b7fa 100644 --- a/intl/build/nsI18nModule.cpp +++ b/intl/build/nsI18nModule.cpp @@ -72,11 +72,6 @@ NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID); NS_DEFINE_NAMED_CID(NS_COLLATION_CID); NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID); #endif -#ifdef XP_OS2 -NS_DEFINE_NAMED_CID(NS_OS2LOCALE_CID); -NS_DEFINE_NAMED_CID(NS_COLLATION_CID); -NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID); -#endif static const mozilla::Module::CIDEntry kIntlCIDs[] = { { &kNS_LBRK_CID, false, nullptr, nsJISx4051LineBreakerConstructor }, @@ -106,11 +101,6 @@ static const mozilla::Module::CIDEntry kIntlCIDs[] = { { &kNS_COLLATION_CID, false, nullptr, nsCollationMacUCConstructor }, { &kNS_DATETIMEFORMAT_CID, false, nullptr, nsDateTimeFormatMacConstructor }, #endif -#ifdef XP_OS2 - { &kNS_OS2LOCALE_CID, false, nullptr, nsOS2LocaleConstructor }, - { &kNS_COLLATION_CID, false, nullptr, nsCollationOS2Constructor }, - { &kNS_DATETIMEFORMAT_CID, false, nullptr, nsDateTimeFormatOS2Constructor }, -#endif { nullptr } }; @@ -142,11 +132,6 @@ static const mozilla::Module::ContractIDEntry kIntlContracts[] = { { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID }, { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID }, #endif -#ifdef XP_OS2 - { NS_OS2LOCALE_CONTRACTID, &kNS_OS2LOCALE_CID }, - { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID }, - { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID }, -#endif { nullptr } }; diff --git a/intl/chardet/tools/GenCyrillicClass.cpp b/intl/chardet/tools/GenCyrillicClass.cpp index f52cf5b4c..06ec7afac 100644 --- a/intl/chardet/tools/GenCyrillicClass.cpp +++ b/intl/chardet/tools/GenCyrillicClass.cpp @@ -12,7 +12,7 @@ #include "nsCRT.h" #include <stdio.h> #include <stdlib.h> -#if defined(XP_WIN) || defined(XP_OS2) +#if defined(XP_WIN) #include <io.h> #endif #ifdef XP_UNIX diff --git a/intl/locale/public/moz.build b/intl/locale/public/moz.build index 1285ec577..63fcb7645 100644 --- a/intl/locale/public/moz.build +++ b/intl/locale/public/moz.build @@ -12,9 +12,7 @@ EXPORTS += [ 'nsDateTimeFormatCID.h', 'nsIDateTimeFormat.h', 'nsILanguageAtomService.h', - 'nsIOS2Locale.h', 'nsIPlatformCharset.h', - 'nsLocaleCID.h', 'nsPosixLocale.h', 'nsWin32Locale.h', ] diff --git a/intl/locale/public/nsIOS2Locale.h b/intl/locale/public/nsIOS2Locale.h deleted file mode 100644 index 2c1379a3c..000000000 --- a/intl/locale/public/nsIOS2Locale.h +++ /dev/null @@ -1,34 +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/. */ - -#ifndef _nsios2locale_h_ -#define _nsios2locale_h_ - -#include "nsISupports.h" -#include "nscore.h" -#include "nsString.h" -#include <os2.h> - -// {F25F74F0-FB59-11d3-A9F2-00203522A03C} -#define NS_IOS2LOCALE_IID \ -{ 0xf25f74f0, 0xfb59, 0x11d3, \ -{ 0xa9, 0xf2, 0x0, 0x20, 0x35, 0x22, 0xa0, 0x3c }} - -#define MAX_LANGUAGE_CODE_LEN 3 -#define MAX_COUNTRY_CODE_LEN 3 -#define MAX_EXTRA_LEN 65 -#define MAX_LOCALE_LEN 128 - -class nsIOS2Locale : public nsISupports -{ - public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOS2LOCALE_IID) - - NS_IMETHOD GetPlatformLocale(const nsAString& locale, PULONG os2Codepage) = 0; - NS_IMETHOD GetXPLocale(const char* os2Locale, nsAString& locale)=0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsIOS2Locale, NS_IOS2LOCALE_IID) - -#endif diff --git a/intl/locale/public/nsLocaleCID.h b/intl/locale/public/nsLocaleCID.h deleted file mode 100644 index bb8ebeb69..000000000 --- a/intl/locale/public/nsLocaleCID.h +++ /dev/null @@ -1,16 +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 nsLocaleCID_h__ -#define nsLocaleCID_h__ - -// {F25F74F1-FB59-11d3-A9F2-00203522A03C} -#define NS_OS2LOCALE_CID \ -{ 0xf25f74f1, 0xfb59, 0x11d3, \ -{ 0xa9, 0xf2, 0x0, 0x20, 0x35, 0x22, 0xa0, 0x3c }} - -#define NS_OS2LOCALE_CONTRACTID "@mozilla.org/locale/os2-locale;1" - -#endif // nsLocaleCID_h__ - diff --git a/intl/locale/src/mac/nsDateTimeFormatMac.cpp b/intl/locale/src/mac/nsDateTimeFormatMac.cpp index 14e3f4aad..ffbbcb898 100644 --- a/intl/locale/src/mac/nsDateTimeFormatMac.cpp +++ b/intl/locale/src/mac/nsDateTimeFormatMac.cpp @@ -8,7 +8,6 @@ #include "nsDateTimeFormatMac.h" #include <CoreFoundation/CFDateFormatter.h> #include "nsIComponentManager.h" -#include "nsLocaleCID.h" #include "nsILocaleService.h" #include "nsCRT.h" #include "plstr.h" diff --git a/intl/locale/src/mac/nsMacCharset.cpp b/intl/locale/src/mac/nsMacCharset.cpp index 27f26c52d..593161a2d 100644 --- a/intl/locale/src/mac/nsMacCharset.cpp +++ b/intl/locale/src/mac/nsMacCharset.cpp @@ -8,7 +8,6 @@ #include "pratom.h" #include "nsCOMPtr.h" #include "nsIServiceManager.h" -#include "nsLocaleCID.h" #include "nsReadableUtils.h" #include "nsPlatformCharset.h" #include "nsEncoderDecoderUtils.h" diff --git a/intl/locale/src/moz.build b/intl/locale/src/moz.build index 7501d33af..a5cd25a51 100644 --- a/intl/locale/src/moz.build +++ b/intl/locale/src/moz.build @@ -6,8 +6,8 @@ toolkit = CONFIG['MOZ_WIDGET_TOOLKIT'] -if toolkit in ('os2', 'windows'): - DIRS += [toolkit] +if toolkit == 'windows': + DIRS += ['windows'] elif toolkit == 'cocoa': DIRS += ['mac'] else: diff --git a/intl/locale/src/nsLocaleConstructors.h b/intl/locale/src/nsLocaleConstructors.h index ba501f8c5..f1a087df9 100644 --- a/intl/locale/src/nsLocaleConstructors.h +++ b/intl/locale/src/nsLocaleConstructors.h @@ -14,7 +14,6 @@ #include "nsIServiceManager.h" #include "nsLanguageAtomService.h" #include "nsPlatformCharset.h" -#include "nsLocaleCID.h" #if defined(XP_MACOSX) #define USE_MAC_LOCALE @@ -29,12 +28,6 @@ #include "nsDateTimeFormatWin.h" #endif -#ifdef XP_OS2 -#include "nsOS2Locale.h" -#include "nsCollationOS2.h" -#include "nsDateTimeFormatOS2.h" -#endif - #ifdef USE_MAC_LOCALE #include "nsCollationMacUC.h" #include "nsDateTimeFormatMac.h" @@ -83,10 +76,4 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationMacUC) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatMac) #endif -#ifdef XP_OS2 -NS_GENERIC_FACTORY_CONSTRUCTOR(nsOS2Locale) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationOS2) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatOS2) -#endif - #endif diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp index ea613e7e6..e7ab2776a 100644 --- a/intl/locale/src/nsLocaleService.cpp +++ b/intl/locale/src/nsLocaleService.cpp @@ -24,9 +24,6 @@ #if defined(XP_WIN) # include "nsWin32Locale.h" -#elif defined(XP_OS2) -# include "unidef.h" -# include "nsIOS2Locale.h" #elif defined(XP_MACOSX) # include <Carbon/Carbon.h> #elif defined(XP_UNIX) @@ -51,7 +48,7 @@ const char* LocaleList[LocaleListLength] = #define NSILOCALE_MAX_ACCEPT_LANGUAGE 16 #define NSILOCALE_MAX_ACCEPT_LENGTH 18 -#if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_OS2) +#if (defined(XP_UNIX) && !defined(XP_MACOSX)) static int posix_locale_category[LocaleListLength] = { LC_COLLATE, @@ -167,54 +164,6 @@ nsLocaleService::nsLocaleService(void) mApplicationLocale = do_QueryInterface(resultLocale); #endif // XP_UNIX -#ifdef XP_OS2 - nsCOMPtr<nsIOS2Locale> os2Converter = do_GetService(NS_OS2LOCALE_CONTRACTID); - nsAutoString xpLocale; - if (os2Converter) { - nsAutoString category; - int i; - - nsRefPtr<nsLocale> resultLocale(new nsLocale()); - - LocaleObject locale_object = NULL; - int result = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, - (UniChar *)L"", &locale_object); - if (result != ULS_SUCCESS) { - int result = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, - (UniChar *)L"en_US", &locale_object); - } - char* lc_temp; - for( i = 0; i < LocaleListLength; i++ ) { - lc_temp = nullptr; - UniQueryLocaleObject(locale_object, - posix_locale_category[i], - UNI_MBS_STRING_POINTER, - (void **)&lc_temp); - category.AssignASCII(LocaleList[i]); - nsresult result; - if (lc_temp != nullptr) - result = os2Converter->GetXPLocale(lc_temp, xpLocale); - else { - char* lang = getenv("LANG"); - if ( lang == nullptr ) { - result = os2Converter->GetXPLocale("en-US", xpLocale); - } - else - result = os2Converter->GetXPLocale(lang, xpLocale); - } - if (NS_FAILED(result)) { - UniFreeMem(lc_temp); - UniFreeLocaleObject(locale_object); - return; - } - resultLocale->AddCategory(category, xpLocale); - UniFreeMem(lc_temp); - } - UniFreeLocaleObject(locale_object); - mSystemLocale = do_QueryInterface(resultLocale); - mApplicationLocale = do_QueryInterface(resultLocale); - } // if ( NS_SUCCEEDED )... -#endif // XP_OS2 #ifdef XP_MACOSX // Get string representation of user's current locale diff --git a/intl/locale/src/os2/Makefile.in b/intl/locale/src/os2/Makefile.in deleted file mode 100644 index be245b349..000000000 --- a/intl/locale/src/os2/Makefile.in +++ /dev/null @@ -1,29 +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/. - -DEPTH = @DEPTH@ -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -EXPORT_LIBRARY = 1 -FORCE_STATIC_LIB = 1 -LIBXUL_LIBRARY = 1 - - -include $(topsrcdir)/config/rules.mk - -INCLUDES += -I$(srcdir)/.. - -nsOS2Charset.$(OBJ_SUFFIX): os2charset.properties.h - -os2charset.properties.h: $(srcdir)/../props2arrays.py os2charset.properties - $(PYTHON) $^ $@ - -GARBAGE += \ - os2charset.properties.h \ - $(NULL) diff --git a/intl/locale/src/os2/moz.build b/intl/locale/src/os2/moz.build deleted file mode 100644 index a59ed2a29..000000000 --- a/intl/locale/src/os2/moz.build +++ /dev/null @@ -1,17 +0,0 @@ -# -*- 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/. - -MODULE = 'locale' - -CPP_SOURCES += [ - 'nsCollationOS2.cpp', - 'nsDateTimeFormatOS2.cpp', - 'nsOS2Charset.cpp', - 'nsOS2Locale.cpp', -] - -LIBRARY_NAME = 'platlocale_s' - diff --git a/intl/locale/src/os2/nsCollationOS2.cpp b/intl/locale/src/os2/nsCollationOS2.cpp deleted file mode 100644 index a1700b325..000000000 --- a/intl/locale/src/os2/nsCollationOS2.cpp +++ /dev/null @@ -1,151 +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, 2000 - * - * Modifications to Mozilla code or documentation - * identified per MPL Section 3.3 - * - * Date Modified by Description of modification - * 07/05/2000 IBM Corp. Reworked file. - */ - -#include "unidef.h" -#include "prmem.h" -#include "nsCollationOS2.h" -#include "nsIServiceManager.h" -#include "nsIComponentManager.h" -#include "nsLocaleCID.h" -#include "nsIPlatformCharset.h" -#include "nsIOS2Locale.h" -#include "nsCOMPtr.h" -#include "nsString.h" -#include "nsCRT.h" - -NS_IMPL_ISUPPORTS1(nsCollationOS2, nsICollation) - -nsCollationOS2::nsCollationOS2() : mCollation(nullptr) -{ -} - -nsCollationOS2::~nsCollationOS2() -{ - if (mCollation) - delete mCollation; -} - -/* Workaround for GCC problem */ -#ifndef LOCI_iCodepage -#define LOCI_iCodepage ((LocaleItem)111) -#endif - -nsresult nsCollationOS2::Initialize(nsILocale *locale) -{ - NS_ASSERTION(!mCollation, "Should only be initialized once"); - - mCollation = new nsCollation; - - return NS_OK; -} - - -nsresult nsCollationOS2::CompareString(int32_t strength, - const nsAString& string1, const nsAString& string2, int32_t* result) -{ - nsAutoString stringNormalized1, stringNormalized2; - if (strength != kCollationCaseSensitive) { - nsresult res; - res = mCollation->NormalizeString(string1, stringNormalized1); - if (NS_FAILED(res)) { - return res; - } - res = mCollation->NormalizeString(string2, stringNormalized2); - if (NS_FAILED(res)) { - return res; - } - } else { - stringNormalized1 = string1; - stringNormalized2 = string2; - } - - LocaleObject locObj = NULL; - int ret = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"", &locObj); - if (ret != ULS_SUCCESS) - UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"C", &locObj); - - *result = UniStrcoll(locObj, (UniChar *)stringNormalized1.get(), (UniChar *)stringNormalized2.get()); - - UniFreeLocaleObject(locObj); - - return NS_OK; -} - - -nsresult nsCollationOS2::AllocateRawSortKey(int32_t strength, - const nsAString& stringIn, uint8_t** key, uint32_t* outLen) -{ - nsresult res = NS_OK; - - nsAutoString stringNormalized; - if (strength != kCollationCaseSensitive) { - res = mCollation->NormalizeString(stringIn, stringNormalized); - if (NS_FAILED(res)) - return res; - } else { - stringNormalized = stringIn; - } - - LocaleObject locObj = NULL; - int ret = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"", &locObj); - if (ret != ULS_SUCCESS) - UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"C", &locObj); - - res = NS_ERROR_FAILURE; // From here on out assume failure... - int length = UniStrxfrm(locObj, NULL, reinterpret_cast<const UniChar *>(stringNormalized.get()),0); - if (length >= 0) { - length += 5; // Allow for the "extra" chars UniStrxfrm() - // will out put (overrunning the buffer if - // you let it...) - // Magic, persistent buffer. If it's not twice the size we need, - // we grow/reallocate it 4X so it doesn't grow often. - static UniChar* pLocalBuffer = nullptr; - static int iBufferLength = 100; - if (iBufferLength < length*2) { - if ( pLocalBuffer ) { - free(pLocalBuffer); - pLocalBuffer = nullptr; - } - iBufferLength = length*4; - } - if (!pLocalBuffer) - pLocalBuffer = (UniChar*) malloc(sizeof(UniChar) * iBufferLength); - if (pLocalBuffer) { - // Do the Xfrm - int uLen = UniStrxfrm(locObj, pLocalBuffer, reinterpret_cast<const UniChar *>(stringNormalized.get()), iBufferLength); - // See how big the result really is - uLen = UniStrlen(pLocalBuffer); - // make sure it will fit in the output buffer... - if (uLen < iBufferLength) { - // Success! - // Give 'em the real size in bytes... - *key = (uint8_t *)nsCRT::strdup((PRUnichar*) pLocalBuffer); - *outLen = uLen * 2 + 2; - res = NS_OK; - } - } - } - UniFreeLocaleObject(locObj); - - return res; -} - -nsresult nsCollationOS2::CompareRawSortKey(const uint8_t* key1, uint32_t len1, - const uint8_t* key2, uint32_t len2, - int32_t* result) -{ - *result = PL_strcmp((const char *)key1, (const char *)key2); - return NS_OK; -} diff --git a/intl/locale/src/os2/nsCollationOS2.h b/intl/locale/src/os2/nsCollationOS2.h deleted file mode 100644 index 4d8e4f555..000000000 --- a/intl/locale/src/os2/nsCollationOS2.h +++ /dev/null @@ -1,33 +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/. */ -#ifndef _nscollationos2_h_ -#define _nscollationos2_h_ - - -#include "nsICollation.h" -#include "nsCollation.h" // static library -#include "nsCRT.h" - - - -class nsCollationOS2 : public nsICollation { - -protected: - nsCollation *mCollation; - nsString mLocale; - nsString mSavedLocale; - -public: - nsCollationOS2(); - ~nsCollationOS2(); - - // nsISupports interface - NS_DECL_ISUPPORTS - - // nsICollation interface - NS_DECL_NSICOLLATION - -}; - -#endif /* nsCollationOS2_h__ */ diff --git a/intl/locale/src/os2/nsDateTimeFormatOS2.cpp b/intl/locale/src/os2/nsDateTimeFormatOS2.cpp deleted file mode 100644 index 2c5865ea1..000000000 --- a/intl/locale/src/os2/nsDateTimeFormatOS2.cpp +++ /dev/null @@ -1,187 +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/. */ - -#include <unidef.h> -#include "nsDateTimeFormatOS2.h" - -NS_IMPL_THREADSAFE_ISUPPORTS1(nsDateTimeFormatOS2,nsIDateTimeFormat) - -#define NSDATETIME_FORMAT_BUFFER_LEN 80 - -#ifndef LOCI_iTime -#define LOCI_iTime ((LocaleItem)73) -#endif - -nsresult nsDateTimeFormatOS2::FormatTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const time_t timetTime, - nsAString &stringOut) -{ - return FormatTMTime(locale, dateFormatSelector, timeFormatSelector, localtime( &timetTime ), stringOut); -} - -// performs a locale sensitive date formatting operation on the struct tm parameter -nsresult nsDateTimeFormatOS2::FormatTMTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const struct tm* tmTime, - nsAString &stringOut) -{ - - nsresult rc = NS_ERROR_FAILURE; - UniChar uFmtD[NSDATETIME_FORMAT_BUFFER_LEN] = { 0 }; - UniChar uFmtT[NSDATETIME_FORMAT_BUFFER_LEN] = { 0 }; - UniChar *pString = nullptr; - LocaleObject locObj = NULL; - int ret = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"", &locObj); - if (ret != ULS_SUCCESS) - UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"C", &locObj); - - bool f24Hour = false; - - UniQueryLocaleItem(locObj, LOCI_iTime, &pString); - - if (pString[0] == '1') { - f24Hour = true; - } - - // set date format - switch (dateFormatSelector) { - case kDateFormatNone: - UniStrcat( uFmtD, (UniChar*)L""); - break; - case kDateFormatLong: - case kDateFormatShort: - UniStrcat( uFmtD, (UniChar*)L"%x"); - break; - case kDateFormatYearMonth: - UniQueryLocaleItem( locObj, DATESEP, &pString); - UniStrcat( uFmtD, (UniChar*)L"%Y"); - UniStrcat( uFmtD, pString); - UniStrcat( uFmtD, (UniChar*)L"%m"); - UniFreeMem(pString); - break; - case kDateFormatWeekday: - UniStrcat( uFmtD, (UniChar*)L"%a"); - break; - default: - UniStrcat( uFmtD, (UniChar*)L""); - } - - // set time format - switch (timeFormatSelector) { - case kTimeFormatNone: - UniStrcat( uFmtT, (UniChar*)L""); - break; - case kTimeFormatSeconds: - UniQueryLocaleItem( locObj, TIMESEP, &pString); - if (f24Hour) - UniStrcat( uFmtT, (UniChar*)L"%H"); - else - UniStrcat( uFmtT, (UniChar*)L"%I"); - UniStrcat( uFmtT, pString); - UniStrcat( uFmtT, (UniChar*)L"%M"); - UniStrcat( uFmtT, pString); - UniStrcat( uFmtT, (UniChar*)L"%S"); - if (!f24Hour) - UniStrcat( uFmtT, (UniChar*)L" %p"); - UniFreeMem(pString); - break; - case kTimeFormatNoSeconds: - UniQueryLocaleItem( locObj, TIMESEP, &pString); - if (f24Hour) - UniStrcat( uFmtT, (UniChar*)L"%H"); - else - UniStrcat( uFmtT, (UniChar*)L"%I"); - UniStrcat( uFmtT, pString); - UniStrcat( uFmtT, (UniChar*)L"%M"); - if (!f24Hour) - UniStrcat( uFmtT, (UniChar*)L" %p"); - UniFreeMem(pString); - break; - case kTimeFormatSecondsForce24Hour: - UniQueryLocaleItem( locObj, TIMESEP, &pString); - UniStrcat( uFmtT, (UniChar*)L"%H"); - UniStrcat( uFmtT, pString); - UniStrcat( uFmtT, (UniChar*)L"%M"); - UniStrcat( uFmtT, pString); - UniStrcat( uFmtT, (UniChar*)L"%S"); - UniFreeMem(pString); - break; - case kTimeFormatNoSecondsForce24Hour: - UniQueryLocaleItem( locObj, TIMESEP, &pString); - UniStrcat( uFmtT, (UniChar*)L"%H"); - UniStrcat( uFmtT, pString); - UniStrcat( uFmtT, (UniChar*)L"%M"); - UniFreeMem(pString); - break; - default: - UniStrcat( uFmtT, (UniChar*)L""); - } - - PRUnichar buffer[NSDATETIME_FORMAT_BUFFER_LEN] = {0}; - if ((dateFormatSelector != kDateFormatNone) && (timeFormatSelector != kTimeFormatNone)) { - UniStrcat( uFmtD, (UniChar*)L" "); - } - UniStrcat( uFmtD, uFmtT); - int length = UniStrftime(locObj, reinterpret_cast<UniChar *>(buffer), - NSDATETIME_FORMAT_BUFFER_LEN, uFmtD, tmTime); - UniFreeLocaleObject(locObj); - - if ( length != 0) { - stringOut.Assign(buffer, length); - rc = NS_OK; - } - - return rc; -} - -// performs a locale sensitive date formatting operation on the PRTime parameter -nsresult nsDateTimeFormatOS2::FormatPRTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const PRTime prTime, - nsAString& stringOut) -{ - PRExplodedTime explodedTime; - PR_ExplodeTime(prTime, PR_LocalTimeParameters, &explodedTime); - - return FormatPRExplodedTime(locale, dateFormatSelector, timeFormatSelector, &explodedTime, stringOut); -} - -// performs a locale sensitive date formatting operation on the PRExplodedTime parameter -nsresult nsDateTimeFormatOS2::FormatPRExplodedTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const PRExplodedTime* explodedTime, - nsAString& stringOut) -{ - struct tm tmTime; - /* be safe and set all members of struct tm to zero - * - * there are other fields in the tm struct that we aren't setting - * (tm_isdst, tm_gmtoff, tm_zone, should we set these?) and since - * tmTime is on the stack, it may be filled with garbage, but - * the garbage may vary. (this may explain why some saw bug #10412, and - * others did not. - * - * when tmTime is passed to strftime() with garbage bad things may happen. - * see bug #10412 - */ - memset( &tmTime, 0, sizeof(tmTime) ); - - tmTime.tm_yday = explodedTime->tm_yday; - tmTime.tm_wday = explodedTime->tm_wday; - tmTime.tm_year = explodedTime->tm_year; - tmTime.tm_year -= 1900; - tmTime.tm_mon = explodedTime->tm_month; - tmTime.tm_mday = explodedTime->tm_mday; - tmTime.tm_hour = explodedTime->tm_hour; - tmTime.tm_min = explodedTime->tm_min; - tmTime.tm_sec = explodedTime->tm_sec; - - return FormatTMTime(locale, dateFormatSelector, timeFormatSelector, &tmTime, stringOut); -} - diff --git a/intl/locale/src/os2/nsDateTimeFormatOS2.h b/intl/locale/src/os2/nsDateTimeFormatOS2.h deleted file mode 100644 index 2201f780e..000000000 --- a/intl/locale/src/os2/nsDateTimeFormatOS2.h +++ /dev/null @@ -1,47 +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/. */ -#ifndef _nsdatetimeformatos2_h_ -#define _nsdatetimeformatos2_h_ - -#include "nsIDateTimeFormat.h" - -class nsDateTimeFormatOS2 : public nsIDateTimeFormat { - - public: - NS_DECL_ISUPPORTS - - // performs a locale sensitive date formatting operation on the time_t parameter - NS_IMETHOD FormatTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const time_t timetTime, - nsAString& stringOut); - - // performs a locale sensitive date formatting operation on the struct tm parameter - NS_IMETHOD FormatTMTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const struct tm* tmTime, - nsAString& stringOut); - - // performs a locale sensitive date formatting operation on the PRTime parameter - NS_IMETHOD FormatPRTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const PRTime prTime, - nsAString& stringOut); - - // performs a locale sensitive date formatting operation on the PRExplodedTime parameter - NS_IMETHOD FormatPRExplodedTime(nsILocale* locale, - const nsDateFormatSelector dateFormatSelector, - const nsTimeFormatSelector timeFormatSelector, - const PRExplodedTime* explodedTime, - nsAString& stringOut); - - nsDateTimeFormatOS2() {} - - virtual ~nsDateTimeFormatOS2() {} -}; - -#endif /* nsDateTimeFormatOS2_h__ */ diff --git a/intl/locale/src/os2/nsOS2Charset.cpp b/intl/locale/src/os2/nsOS2Charset.cpp deleted file mode 100644 index 48c02fa76..000000000 --- a/intl/locale/src/os2/nsOS2Charset.cpp +++ /dev/null @@ -1,121 +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/Util.h" - -#include "nsIPlatformCharset.h" -#include "nsUConvPropertySearch.h" -#include "pratom.h" -#define INCL_WIN -#include <os2.h> -#include "nsIOS2Locale.h" -#include "nsCOMPtr.h" -#include "nsReadableUtils.h" -#include "nsLocaleCID.h" -#include "nsIServiceManager.h" -#include "nsPlatformCharset.h" - -using namespace mozilla; - -static const char* kOS2Charsets[][3] = { -#include "os2charset.properties.h" -}; - -NS_IMPL_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset) - -nsPlatformCharset::nsPlatformCharset() -{ - UINT acp = ::WinQueryCp(HMQ_CURRENT); - int32_t acpint = (int32_t)(acp & 0x00FFFF); - nsAutoString acpKey(NS_LITERAL_STRING("os2.")); - acpKey.AppendInt(acpint, 10); - nsresult res = MapToCharset(acpKey, mCharset); -} - -nsPlatformCharset::~nsPlatformCharset() -{ -} - -nsresult -nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset) -{ - nsAutoCString key; - LossyCopyUTF16toASCII(inANSICodePage, key); - - nsresult rv = nsUConvPropertySearch::SearchPropertyValue(kOS2Charsets, - ArrayLength(kOS2Charsets), key, outCharset); - if (NS_FAILED(rv)) { - outCharset.AssignLiteral("IBM850"); - } - return rv; -} - -NS_IMETHODIMP -nsPlatformCharset::GetCharset(nsPlatformCharsetSel selector, - nsACString& oResult) -{ - if ((selector == kPlatformCharsetSel_4xBookmarkFile) || (selector == kPlatformCharsetSel_4xPrefsJS)) { - if ((mCharset.Find("IBM850", IGNORE_CASE) != -1) || (mCharset.Find("IBM437", IGNORE_CASE) != -1)) - oResult.AssignLiteral("ISO-8859-1"); - else if (mCharset.Find("IBM852", IGNORE_CASE) != -1) - oResult.AssignLiteral("windows-1250"); - else if ((mCharset.Find("IBM855", IGNORE_CASE) != -1) || (mCharset.Find("IBM866", IGNORE_CASE) != -1)) - oResult.AssignLiteral("windows-1251"); - else if ((mCharset.Find("IBM869", IGNORE_CASE) != -1) || (mCharset.Find("IBM813", IGNORE_CASE) != -1)) - oResult.AssignLiteral("windows-1253"); - else if (mCharset.Find("IBM857", IGNORE_CASE) != -1) - oResult.AssignLiteral("windows-1254"); - else - oResult = mCharset; - } else { - oResult = mCharset; - } - return NS_OK; -} - -NS_IMETHODIMP -nsPlatformCharset::GetDefaultCharsetForLocale(const nsAString& localeName, nsACString &oResult) -{ - nsCOMPtr<nsIOS2Locale> os2Locale; - ULONG codepage; - char acp_name[6]; - - // - // convert locale name to a code page - // - nsresult rv; - oResult.Truncate(); - - os2Locale = do_GetService(NS_OS2LOCALE_CONTRACTID, &rv); - if (NS_FAILED(rv)) { return rv; } - - rv = os2Locale->GetPlatformLocale(localeName, &codepage); - if (NS_FAILED(rv)) { return rv; } - - nsAutoString os2_key(NS_LITERAL_STRING("os2.")); - os2_key.AppendInt((uint32_t)codepage); - - return MapToCharset(os2_key, oResult); - -} - -NS_IMETHODIMP -nsPlatformCharset::Init() -{ - return NS_OK; -} - -nsresult -nsPlatformCharset::InitGetCharset(nsACString &oString) -{ - return NS_OK; -} - -nsresult -nsPlatformCharset::VerifyCharset(nsCString &aCharset) -{ - return NS_OK; -} diff --git a/intl/locale/src/os2/nsOS2Locale.cpp b/intl/locale/src/os2/nsOS2Locale.cpp deleted file mode 100644 index 28c3a267f..000000000 --- a/intl/locale/src/os2/nsOS2Locale.cpp +++ /dev/null @@ -1,264 +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, 2000 - * - * Modifications to Mozilla code or documentation - * identified per MPL Section 3.3 - * - * Date Modified by Description of modification - * - * 07/05/2000 IBM Corp. renamed file to nsOS2Locale.cpp from ns LocaleOS2.cpp - * added implementation for GetPlatformLocale, and GetXPlatformLocale using Unix model - * created ParseLocaleString method - */ - -#include "nsISupports.h" -#include "nscore.h" -#include "nsString.h" -#include "nsOS2Locale.h" -#include "nsLocaleCID.h" -#include "prprf.h" -#include "nsReadableUtils.h" -#include <unidef.h> - -extern "C" { -#include <callconv.h> -int APIENTRY UniQueryLocaleValue ( const LocaleObject locale_object, - LocaleItem item, - int *info_item); -} - -/* nsOS2Locale ISupports */ -NS_IMPL_ISUPPORTS1(nsOS2Locale,nsIOS2Locale) - -nsOS2Locale::nsOS2Locale(void) -{ -} - -nsOS2Locale::~nsOS2Locale(void) -{ - -} - -/* Workaround for GCC problem */ -#ifndef LOCI_sName -#define LOCI_sName ((LocaleItem)100) -#endif - -NS_IMETHODIMP -nsOS2Locale::GetPlatformLocale(const nsAString& locale, PULONG os2Codepage) -{ - LocaleObject locObj = NULL; - int codePage; - nsAutoString tempLocale(locale); - tempLocale.ReplaceChar('-', '_'); - - - int ret = UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)PromiseFlatString(tempLocale).get(), &locObj); - if (ret != ULS_SUCCESS) - UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"C", &locObj); - - ret = UniQueryLocaleValue(locObj, LOCI_iCodepage, &codePage); - if (ret != ULS_SUCCESS) - return NS_ERROR_FAILURE; - - if (codePage == 437) { - *os2Codepage = 850; - } else { - *os2Codepage = codePage; - } - UniFreeLocaleObject(locObj); - - return NS_OK; -} - -NS_IMETHODIMP -nsOS2Locale::GetXPLocale(const char* os2Locale, nsAString& locale) -{ - char country_code[MAX_COUNTRY_CODE_LEN]; - char lang_code[MAX_LANGUAGE_CODE_LEN]; - char extra[MAX_EXTRA_LEN]; - char os2_locale[MAX_LOCALE_LEN]; - - if (os2Locale!=nullptr) { - if (strcmp(os2Locale,"C")==0 || strcmp(os2Locale,"OS2")==0) { - locale.AssignLiteral("en-US"); - return NS_OK; - } - if (!ParseLocaleString(os2Locale,lang_code,country_code,extra,'_')) { -// * locale = "x-user-defined"; - // use os2 if parse failed - CopyASCIItoUTF16(nsDependentCString(os2Locale), locale); - return NS_OK; - } - - if (*country_code) { - if (*extra) { - PR_snprintf(os2_locale,MAX_LOCALE_LEN,"%s-%s.%s",lang_code,country_code,extra); - } - else { - PR_snprintf(os2_locale,MAX_LOCALE_LEN,"%s-%s",lang_code,country_code); - } - } - else { - if (*extra) { - PR_snprintf(os2_locale,MAX_LOCALE_LEN,"%s.%s",lang_code,extra); - } - else { - PR_snprintf(os2_locale,MAX_LOCALE_LEN,"%s",lang_code); - } - } - - CopyASCIItoUTF16(nsDependentCString(os2_locale), locale); - return NS_OK; - - } - - return NS_ERROR_FAILURE; -} - -// copied from nsPosixLocale::ParseLocaleString: -// returns false/true depending on if it was of the form LL-CC.Extra -// or possibly ll_CC_Extra (depending on the separator, which happens on OS/2 -bool -nsOS2Locale::ParseLocaleString(const char* locale_string, char* language, char* country, char* extra, char separator) -{ - const char *src = locale_string; - char modifier[MAX_EXTRA_LEN+1]; - char *dest; - int dest_space, len; - - *language = '\0'; - *country = '\0'; - *extra = '\0'; - if (strlen(locale_string) < 2) { - return(false); - } - - // - // parse the language part - // - dest = language; - dest_space = MAX_LANGUAGE_CODE_LEN; - while ((*src) && (isalpha(*src)) && (dest_space--)) { - *dest++ = tolower(*src++); - } - *dest = '\0'; - len = dest - language; - if ((len != 2) && (len != 3)) { - NS_ASSERTION((len == 2) || (len == 3), "language code too short"); - NS_ASSERTION(len < 3, "reminder: verify we can handle 3+ character language code in all parts of the system; eg: language packs"); - *language = '\0'; - return(false); - } - - // check if all done - if (*src == '\0') { - return(true); - } - - if ((*src != '_') && (*src != '-') && (*src != '.') && (*src != '@')) { - NS_ASSERTION(isalpha(*src), "language code too long"); - NS_ASSERTION(!isalpha(*src), "unexpected language/country separator"); - *language = '\0'; - return(false); - } - - // - // parse the country part - // - if ((*src == '_') || (*src == '-')) { - src++; - dest = country; - dest_space = MAX_COUNTRY_CODE_LEN; - while ((*src) && (isalpha(*src)) && (dest_space--)) { - *dest++ = toupper(*src++); - } - *dest = '\0'; - len = dest - country; - if (len != 2) { - NS_ASSERTION(len == 2, "unexpected country code length"); - *language = '\0'; - *country = '\0'; - return(false); - } - } - - // check if all done - if (*src == '\0') { - return(true); - } - - if ((*src != '.') && (*src != '@') && (*src != separator)) { - NS_ASSERTION(isalpha(*src), "country code too long"); - NS_ASSERTION(!isalpha(*src), "unexpected country/extra separator"); - *language = '\0'; - *country = '\0'; - return(false); - } - - // - // handle the extra part - // - if (*src == '.') { - src++; // move past the extra part separator - dest = extra; - dest_space = MAX_EXTRA_LEN; - while ((*src) && (*src != '@') && (dest_space--)) { - *dest++ = *src++; - } - *dest = '\0'; - len = dest - extra; - if (len < 1) { - NS_ASSERTION(len > 0, "found country/extra separator but no extra code"); - *language = '\0'; - *country = '\0'; - *extra = '\0'; - return(false); - } - } - - // check if all done - if (*src == '\0') { - return(true); - } - - // - // handle the modifier part - // - if ((*src == '@') || (*src == separator)) { - src++; // move past the modifier separator - NS_ASSERTION(stricmp("euro",src) == 0, "found non euro modifier"); - dest = modifier; - dest_space = MAX_EXTRA_LEN; - while ((*src) && (dest_space--)) { - *dest++ = *src++; - } - *dest = '\0'; - len = dest - modifier; - if (len < 1) { - NS_ASSERTION(len > 0, "found modifier separator but no modifier code"); - *language = '\0'; - *country = '\0'; - *extra = '\0'; - *modifier = '\0'; - return(false); - } - } - - // check if all done - if (*src == '\0') { - return(true); - } - - NS_ASSERTION(*src == '\0', "extra/modifier code too long"); - *language = '\0'; - *country = '\0'; - *extra = '\0'; - - return(false); -} diff --git a/intl/locale/src/os2/nsOS2Locale.h b/intl/locale/src/os2/nsOS2Locale.h deleted file mode 100644 index 592eb9569..000000000 --- a/intl/locale/src/os2/nsOS2Locale.h +++ /dev/null @@ -1,32 +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/. */ -#ifndef _nslocaleos2_h_ -#define _nslocaleos2_h_ - - -#include "nsISupports.h" -#include "nscore.h" -#include "nsString.h" -#include "nsIOS2Locale.h" -#include <os2.h> - - -class nsOS2Locale : public nsIOS2Locale { - - NS_DECL_ISUPPORTS - -public: - - nsOS2Locale(); - virtual ~nsOS2Locale(); - - NS_IMETHOD GetPlatformLocale(const nsAString& locale, PULONG os2Codepage); - NS_IMETHOD GetXPLocale(const char* os2Locale, nsAString& locale); - -protected: - inline bool ParseLocaleString(const char* locale_string, char* language, char* country, char* extra, char separator); - -}; - -#endif diff --git a/intl/locale/src/os2/os2charset.properties b/intl/locale/src/os2/os2charset.properties deleted file mode 100644 index 12641acd6..000000000 --- a/intl/locale/src/os2/os2charset.properties +++ /dev/null @@ -1,28 +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 file map an OS/2 codepage to a charset name -# We use this to figure out the charset of file system, clipboard, etc -# - -os2.850=IBM850 -os2.852=IBM852 -os2.855=IBM855 -os2.857=IBM857 -os2.862=IBM862 -os2.864=IBM864 -os2.866=IBM866 -os2.874=TIS-620 -os2.932=Shift_JIS -os2.936=GB2312 -os2.949=EUC-KR -os2.950=Big5 -os2.1381=GB2312 -os2.1386=gbk -os2.813=ISO-8859-7 -os2.915=ISO-8859-5 -os2.1004=ISO-8859-1 -os2.921=ISO-8859-13 -os2.1125=IBM1125 -os2.1131=IBM1131 diff --git a/intl/locale/src/windows/nsCollationWin.cpp b/intl/locale/src/windows/nsCollationWin.cpp index 8114a0bf4..8b0f5f767 100644 --- a/intl/locale/src/windows/nsCollationWin.cpp +++ b/intl/locale/src/windows/nsCollationWin.cpp @@ -7,7 +7,6 @@ #include "nsCollationWin.h" #include "nsIServiceManager.h" #include "nsIComponentManager.h" -#include "nsLocaleCID.h" #include "nsILocaleService.h" #include "nsIPlatformCharset.h" #include "nsWin32Locale.h" diff --git a/intl/locale/src/windows/nsDateTimeFormatWin.cpp b/intl/locale/src/windows/nsDateTimeFormatWin.cpp index 1d27115b3..acc9781ca 100644 --- a/intl/locale/src/windows/nsDateTimeFormatWin.cpp +++ b/intl/locale/src/windows/nsDateTimeFormatWin.cpp @@ -6,7 +6,6 @@ #include "nsDateTimeFormatWin.h" #include "nsIServiceManager.h" #include "nsIComponentManager.h" -#include "nsLocaleCID.h" #include "nsILocaleService.h" #include "nsWin32Locale.h" #include "nsUnicharUtils.h" diff --git a/intl/locale/src/windows/nsWin32Locale.cpp b/intl/locale/src/windows/nsWin32Locale.cpp index 55fd56bcb..afd6f4a4e 100644 --- a/intl/locale/src/windows/nsWin32Locale.cpp +++ b/intl/locale/src/windows/nsWin32Locale.cpp @@ -10,7 +10,6 @@ #include "nsXPCOMStrings.h" #include "nsReadableUtils.h" #include "nsWin32Locale.h" -#include "nsLocaleCID.h" #include "prprf.h" #include <windows.h> #include "nsCRT.h" diff --git a/intl/locale/src/windows/nsWinCharset.cpp b/intl/locale/src/windows/nsWinCharset.cpp index d2e4e773e..e7422598a 100644 --- a/intl/locale/src/windows/nsWinCharset.cpp +++ b/intl/locale/src/windows/nsWinCharset.cpp @@ -12,7 +12,6 @@ #include "nsWin32Locale.h" #include "nsCOMPtr.h" #include "nsReadableUtils.h" -#include "nsLocaleCID.h" #include "nsServiceManagerUtils.h" #include "nsPlatformCharset.h" #include "nsEncoderDecoderUtils.h" diff --git a/intl/locale/tests/unit/xpcshell.ini b/intl/locale/tests/unit/xpcshell.ini index d0ce9bdcf..9c0d69f47 100644 --- a/intl/locale/tests/unit/xpcshell.ini +++ b/intl/locale/tests/unit/xpcshell.ini @@ -7,7 +7,7 @@ run-if = toolkit == "windows" || toolkit == "cocoa" [test_bug371611.js] [test_bug374040.js] -skip-if = toolkit == "windows" || toolkit == "cocoa" || toolkit == "os2" +skip-if = toolkit == "windows" || toolkit == "cocoa" [test_pluralForm.js] [test_pluralForm_english.js] diff --git a/intl/uconv/src/nsUConvModule.cpp b/intl/uconv/src/nsUConvModule.cpp index a13d578df..6650ec1a5 100644 --- a/intl/uconv/src/nsUConvModule.cpp +++ b/intl/uconv/src/nsUConvModule.cpp @@ -163,22 +163,12 @@ #include "nsCP857ToUnicode.h" #include "nsCP862ToUnicode.h" #include "nsCP864ToUnicode.h" -#ifdef XP_OS2 -#include "nsCP869ToUnicode.h" -#include "nsCP1125ToUnicode.h" -#include "nsCP1131ToUnicode.h" -#endif #include "nsUnicodeToCP850.h" #include "nsUnicodeToCP852.h" #include "nsUnicodeToCP855.h" #include "nsUnicodeToCP857.h" #include "nsUnicodeToCP862.h" #include "nsUnicodeToCP864.h" -#ifdef XP_OS2 -#include "nsUnicodeToCP869.h" -#include "nsUnicodeToCP1125.h" -#include "nsUnicodeToCP1131.h" -#endif // ucvja #include "nsUCVJACID.h" @@ -303,11 +293,6 @@ NS_UCONV_REG_UNREG("IBM855", NS_CP855TOUNICODE_CID, NS_UNICODETOCP855_CID) NS_UCONV_REG_UNREG("IBM857", NS_CP857TOUNICODE_CID, NS_UNICODETOCP857_CID) NS_UCONV_REG_UNREG("IBM862", NS_CP862TOUNICODE_CID, NS_UNICODETOCP862_CID) NS_UCONV_REG_UNREG("IBM864", NS_CP864TOUNICODE_CID, NS_UNICODETOCP864_CID) -#ifdef XP_OS2 -NS_UCONV_REG_UNREG("IBM869", NS_CP869TOUNICODE_CID, NS_UNICODETOCP869_CID) -NS_UCONV_REG_UNREG("IBM1125", NS_CP1125TOUNICODE_CID, NS_UNICODETOCP1125_CID) -NS_UCONV_REG_UNREG("IBM1131", NS_CP1131TOUNICODE_CID, NS_UNICODETOCP1131_CID) -#endif // ucvja NS_UCONV_REG_UNREG("Shift_JIS", NS_SJISTOUNICODE_CID, NS_UNICODETOSJIS_CID) @@ -647,22 +632,12 @@ NS_DEFINE_NAMED_CID(NS_CP855TOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_CP857TOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_CP862TOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_CP864TOUNICODE_CID); -#ifdef XP_OS2 -NS_DEFINE_NAMED_CID(NS_CP869TOUNICODE_CID); -NS_DEFINE_NAMED_CID(NS_CP1125TOUNICODE_CID); -NS_DEFINE_NAMED_CID(NS_CP1131TOUNICODE_CID); -#endif NS_DEFINE_NAMED_CID(NS_UNICODETOCP850_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOCP852_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOCP855_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOCP857_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOCP862_CID); NS_DEFINE_NAMED_CID(NS_UNICODETOCP864_CID); -#ifdef XP_OS2 -NS_DEFINE_NAMED_CID(NS_UNICODETOCP869_CID); -NS_DEFINE_NAMED_CID(NS_UNICODETOCP1125_CID); -NS_DEFINE_NAMED_CID(NS_UNICODETOCP1131_CID); -#endif NS_DEFINE_NAMED_CID(NS_SJISTOUNICODE_CID); NS_DEFINE_NAMED_CID(NS_EUCJPTOUNICODE_CID); NS_DEFINE_NAMED_CID( NS_ISO2022JPTOUNICODE_CID); @@ -832,22 +807,12 @@ static const mozilla::Module::CIDEntry kUConvCIDs[] = { { &kNS_CP857TOUNICODE_CID, false, nullptr, nsCP857ToUnicodeConstructor }, { &kNS_CP862TOUNICODE_CID, false, nullptr, nsCP862ToUnicodeConstructor }, { &kNS_CP864TOUNICODE_CID, false, nullptr, nsCP864ToUnicodeConstructor }, -#ifdef XP_OS2 - { &kNS_CP869TOUNICODE_CID, false, nullptr, nsCP869ToUnicodeConstructor }, - { &kNS_CP1125TOUNICODE_CID, false, nullptr, nsCP1125ToUnicodeConstructor }, - { &kNS_CP1131TOUNICODE_CID, false, nullptr, nsCP1131ToUnicodeConstructor }, -#endif { &kNS_UNICODETOCP850_CID, false, nullptr, nsUnicodeToCP850Constructor }, { &kNS_UNICODETOCP852_CID, false, nullptr, nsUnicodeToCP852Constructor }, { &kNS_UNICODETOCP855_CID, false, nullptr, nsUnicodeToCP855Constructor }, { &kNS_UNICODETOCP857_CID, false, nullptr, nsUnicodeToCP857Constructor }, { &kNS_UNICODETOCP862_CID, false, nullptr, nsUnicodeToCP862Constructor }, { &kNS_UNICODETOCP864_CID, false, nullptr, nsUnicodeToCP864Constructor }, -#ifdef XP_OS2 - { &kNS_UNICODETOCP869_CID, false, nullptr, nsUnicodeToCP869Constructor }, - { &kNS_UNICODETOCP1125_CID, false, nullptr, nsUnicodeToCP1125Constructor }, - { &kNS_UNICODETOCP1131_CID, false, nullptr, nsUnicodeToCP1131Constructor }, -#endif { &kNS_SJISTOUNICODE_CID, false, nullptr, nsShiftJISToUnicodeConstructor }, { &kNS_EUCJPTOUNICODE_CID, false, nullptr, nsEUCJPToUnicodeV2Constructor }, { &kNS_ISO2022JPTOUNICODE_CID, false, nullptr, nsISO2022JPToUnicodeV2Constructor }, @@ -1019,22 +984,12 @@ static const mozilla::Module::ContractIDEntry kUConvContracts[] = { { NS_UNICODEDECODER_CONTRACTID_BASE "IBM857", &kNS_CP857TOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "IBM862", &kNS_CP862TOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "IBM864", &kNS_CP864TOUNICODE_CID }, -#ifdef XP_OS2 - { NS_UNICODEDECODER_CONTRACTID_BASE "IBM869", &kNS_CP869TOUNICODE_CID }, - { NS_UNICODEDECODER_CONTRACTID_BASE "IBM1125", &kNS_CP1125TOUNICODE_CID }, - { NS_UNICODEDECODER_CONTRACTID_BASE "IBM1131", &kNS_CP1131TOUNICODE_CID }, -#endif { NS_UNICODEENCODER_CONTRACTID_BASE "IBM850", &kNS_UNICODETOCP850_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "IBM852", &kNS_UNICODETOCP852_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "IBM855", &kNS_UNICODETOCP855_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "IBM857", &kNS_UNICODETOCP857_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "IBM862", &kNS_UNICODETOCP862_CID }, { NS_UNICODEENCODER_CONTRACTID_BASE "IBM864", &kNS_UNICODETOCP864_CID }, -#ifdef XP_OS2 - { NS_UNICODEENCODER_CONTRACTID_BASE "IBM869", &kNS_UNICODETOCP869_CID }, - { NS_UNICODEENCODER_CONTRACTID_BASE "IBM1125", &kNS_UNICODETOCP1125_CID }, - { NS_UNICODEENCODER_CONTRACTID_BASE "IBM1131", &kNS_UNICODETOCP1131_CID }, -#endif { NS_UNICODEDECODER_CONTRACTID_BASE "Shift_JIS", &kNS_SJISTOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "EUC-JP", &kNS_EUCJPTOUNICODE_CID }, { NS_UNICODEDECODER_CONTRACTID_BASE "ISO-2022-JP", &kNS_ISO2022JPTOUNICODE_CID }, diff --git a/intl/uconv/tests/plattest.cpp b/intl/uconv/tests/plattest.cpp index 69ada9a72..4fbe932e6 100644 --- a/intl/uconv/tests/plattest.cpp +++ b/intl/uconv/tests/plattest.cpp @@ -6,7 +6,6 @@ #include "nsILocaleService.h" #include "nsCOMPtr.h" #include "nsReadableUtils.h" -#include "nsLocaleCID.h" #include "nsIComponentManager.h" #include <stdio.h> diff --git a/intl/uconv/ucvibm/nsCP1125ToUnicode.cpp b/intl/uconv/ucvibm/nsCP1125ToUnicode.cpp deleted file mode 100644 index ed6a3f53a..000000000 --- a/intl/uconv/ucvibm/nsCP1125ToUnicode.cpp +++ /dev/null @@ -1,24 +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/. */ - -#include "nsUCConstructors.h" -#include "nsCP1125ToUnicode.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -static const uint16_t g_utMappingTable[] = { -#include "cp1125.ut" -}; - -//---------------------------------------------------------------------- -// Class nsCP1125ToUnicode [implementation] - -nsresult -nsCP1125ToUnicodeConstructor(nsISupports* aOuter, REFNSIID aIID, - void **aResult) -{ - return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, - aOuter, aIID, aResult); -} diff --git a/intl/uconv/ucvibm/nsCP1125ToUnicode.h b/intl/uconv/ucvibm/nsCP1125ToUnicode.h deleted file mode 100644 index ba95b4788..000000000 --- a/intl/uconv/ucvibm/nsCP1125ToUnicode.h +++ /dev/null @@ -1,17 +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/. */ - -#ifndef nsCP1125ToUnicode_h___ -#define nsCP1125ToUnicode_h___ - -#include "nsISupports.h" -/** - * A character set converter from CP1125 to Unicode. - */ -nsresult -nsCP1125ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - - -#endif /* !nsCP1125ToUnicode_h___ */ diff --git a/intl/uconv/ucvibm/nsCP1131ToUnicode.cpp b/intl/uconv/ucvibm/nsCP1131ToUnicode.cpp deleted file mode 100644 index 7698b0ff6..000000000 --- a/intl/uconv/ucvibm/nsCP1131ToUnicode.cpp +++ /dev/null @@ -1,24 +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/. */ - -#include "nsUCConstructors.h" -#include "nsCP1131ToUnicode.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -static const uint16_t g_utMappingTable[] = { -#include "cp1131.ut" -}; - -//---------------------------------------------------------------------- -// Class nsCP1131ToUnicode [implementation] - -nsresult -nsCP1131ToUnicodeConstructor(nsISupports* aOuter, REFNSIID aIID, - void **aResult) -{ - return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, - aOuter, aIID, aResult); -} diff --git a/intl/uconv/ucvibm/nsCP1131ToUnicode.h b/intl/uconv/ucvibm/nsCP1131ToUnicode.h deleted file mode 100644 index bef71017c..000000000 --- a/intl/uconv/ucvibm/nsCP1131ToUnicode.h +++ /dev/null @@ -1,17 +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/. */ - -#ifndef nsCP1131ToUnicode_h___ -#define nsCP1131ToUnicode_h___ - -#include "nsISupports.h" -/** - * A character set converter from CP1131 to Unicode. - */ -nsresult -nsCP1131ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - - -#endif /* !nsCP1131ToUnicode_h___ */ diff --git a/intl/uconv/ucvibm/nsCP869ToUnicode.cpp b/intl/uconv/ucvibm/nsCP869ToUnicode.cpp deleted file mode 100644 index aa63133fe..000000000 --- a/intl/uconv/ucvibm/nsCP869ToUnicode.cpp +++ /dev/null @@ -1,22 +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/. */ - -#include "nsUCConstructors.h" -#include "nsCP869ToUnicode.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -static const uint16_t g_utMappingTable[] = { -#include "cp869.ut" -}; - -nsresult -nsCP869ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult) -{ - return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable, - aOuter, aIID, aResult); -} - diff --git a/intl/uconv/ucvibm/nsCP869ToUnicode.h b/intl/uconv/ucvibm/nsCP869ToUnicode.h deleted file mode 100644 index 601515022..000000000 --- a/intl/uconv/ucvibm/nsCP869ToUnicode.h +++ /dev/null @@ -1,18 +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/. */ - -#ifndef nsCP869ToUnicode_h___ -#define nsCP869ToUnicode_h___ - -#include "nsISupports.h" - -/** - * A character set converter from CP869 to Unicode. - */ -nsresult -nsCP869ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - - -#endif /* nsCP869ToUnicode_h___ */ diff --git a/intl/uconv/ucvibm/nsUnicodeToCP1125.cpp b/intl/uconv/ucvibm/nsUnicodeToCP1125.cpp deleted file mode 100644 index c1d382d8d..000000000 --- a/intl/uconv/ucvibm/nsUnicodeToCP1125.cpp +++ /dev/null @@ -1,23 +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/. */ - -#include "nsUCConstructors.h" -#include "nsUnicodeToCP1125.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -static const uint16_t g_ufMappingTable[] = { -#include "cp1125.uf" -}; - -nsresult -nsUnicodeToCP1125Constructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult) -{ - return CreateTableEncoder(u1ByteCharset, - (uMappingTable*) &g_ufMappingTable, 1, - aOuter, aIID, aResult); -} - diff --git a/intl/uconv/ucvibm/nsUnicodeToCP1125.h b/intl/uconv/ucvibm/nsUnicodeToCP1125.h deleted file mode 100644 index e69163851..000000000 --- a/intl/uconv/ucvibm/nsUnicodeToCP1125.h +++ /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/. */ - -#ifndef nsUnicodeToCP1125_h___ -#define nsUnicodeToCP1125_h___ - -#include "nsISupports.h" - - -/** - * A character set converter from Unicode to CP1125. - */ -nsresult -nsUnicodeToCP1125Constructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - - -#endif /* !nsUnicodeToCP1125_h___ */ diff --git a/intl/uconv/ucvibm/nsUnicodeToCP1131.cpp b/intl/uconv/ucvibm/nsUnicodeToCP1131.cpp deleted file mode 100644 index b185565c2..000000000 --- a/intl/uconv/ucvibm/nsUnicodeToCP1131.cpp +++ /dev/null @@ -1,23 +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/. */ - -#include "nsUCConstructors.h" -#include "nsUnicodeToCP1131.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -static const uint16_t g_ufMappingTable[] = { -#include "cp1131.uf" -}; - -nsresult -nsUnicodeToCP1131Constructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult) -{ - return CreateTableEncoder(u1ByteCharset, - (uMappingTable*) &g_ufMappingTable, 1, - aOuter, aIID, aResult); -} - diff --git a/intl/uconv/ucvibm/nsUnicodeToCP1131.h b/intl/uconv/ucvibm/nsUnicodeToCP1131.h deleted file mode 100644 index 8710e1dea..000000000 --- a/intl/uconv/ucvibm/nsUnicodeToCP1131.h +++ /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/. */ - -#ifndef nsUnicodeToCP1131_h___ -#define nsUnicodeToCP1131_h___ - -#include "nsISupports.h" - - -/** - * A character set converter from Unicode to CP1131. - */ -nsresult -nsUnicodeToCP1131Constructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - - -#endif /* !nsUnicodeToCP1131_h___ */ diff --git a/intl/uconv/ucvibm/nsUnicodeToCP869.cpp b/intl/uconv/ucvibm/nsUnicodeToCP869.cpp deleted file mode 100644 index 7a28359d8..000000000 --- a/intl/uconv/ucvibm/nsUnicodeToCP869.cpp +++ /dev/null @@ -1,23 +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/. */ - -#include "nsUCConstructors.h" -#include "nsUnicodeToCP869.h" - -//---------------------------------------------------------------------- -// Global functions and data [declaration] - -static const uint16_t g_ufMappingTable[] = { -#include "cp869.uf" -}; - -nsresult -nsUnicodeToCP869Constructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult) -{ - return CreateTableEncoder(u1ByteCharset, - (uMappingTable*) &g_ufMappingTable, 1, - aOuter, aIID, aResult); -} - diff --git a/intl/uconv/ucvibm/nsUnicodeToCP869.h b/intl/uconv/ucvibm/nsUnicodeToCP869.h deleted file mode 100644 index 7c0f810b3..000000000 --- a/intl/uconv/ucvibm/nsUnicodeToCP869.h +++ /dev/null @@ -1,17 +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/. */ - -#ifndef nsUnicodeToCP869_h___ -#define nsUnicodeToCP869_h___ - -#include "nsISupports.h" - -/** - * A character set converter from Unicode to CP869. - */ -nsresult -nsUnicodeToCP869Constructor(nsISupports *aOuter, REFNSIID aIID, - void **aResult); - -#endif /* nsUnicodeToCP869_h___ */ diff --git a/intl/uconv/ucvja/nsJapaneseToUnicode.cpp b/intl/uconv/ucvja/nsJapaneseToUnicode.cpp index c4277182b..07f5c49f0 100644 --- a/intl/uconv/ucvja/nsJapaneseToUnicode.cpp +++ b/intl/uconv/ucvja/nsJapaneseToUnicode.cpp @@ -15,18 +15,9 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); -#ifdef XP_OS2 - // HTML5-incompliant behavior for OS/2, see bug 108136 - // This is bogus. The right fix would be working around the font problems - // in OS/2 gfx, since this "fix" introduces script-visible DOM differences - // between the platforms. - #define SJIS_INDEX gIBM943Index[0] - #define JIS0208_INDEX gIBM943Index[1] -#else - // HTML5 says to use Windows-31J instead of the real Shift_JIS for decoding - #define SJIS_INDEX gCP932Index[0] - #define JIS0208_INDEX gCP932Index[1] -#endif +// 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 |