diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index 122163e9f8..c74bcd3cea 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -56,10 +56,12 @@ if $(HAIKU_BUILD_FEATURE_SSL) { # ICU # Note ICU isn't actually optional, but is still an external package -HAIKU_ICU_GCC_2_PACKAGE = icu-4.4.1-r1a3-x86-gcc2-2011-05-29.zip ; -HAIKU_ICU_GCC_4_PACKAGE = icu-4.4.1-r1a3-x86-gcc4-2011-05-29.zip ; +HAIKU_ICU_GCC_2_PACKAGE = icu-4.8.1-x86-gcc2-2011-08-18.zip ; +HAIKU_ICU_GCC_4_PACKAGE = icu-4.8.1-x86-gcc4-2011-08-18.zip ; +HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.8.1-2011-08-18.zip ; + +# TODO: this needs to be upgraded before ICU can be used on PPC! HAIKU_ICU_PPC_PACKAGE = icu-4.4.1-ppc-2010-08-17.zip ; -HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.4.1-2010-07-26.zip ; if $(TARGET_ARCH) = ppc { local icu_package = $(HAIKU_ICU_PPC_PACKAGE) ; @@ -105,13 +107,20 @@ if $(TARGET_ARCH) = ppc { # extract libraries HAIKU_ICU_LIBS = [ ExtractArchive $(HAIKU_ICU_DIR) : - libicudata.so.44 - libicui18n.so.44 - libicuio.so.44 - libicule.so.44 - libiculx.so.44 - libicutu.so.44 - libicuuc.so.44 + libicudata.so.48 + libicudata.so.48.1 + libicui18n.so.48 + libicui18n.so.48.1 + libicuio.so.48 + libicuio.so.48.1 + libicule.so.48 + libicule.so.48.1 + libiculx.so.48 + libiculx.so.48.1 + libicutu.so.48 + libicutu.so.48.1 + libicuuc.so.48 + libicuuc.so.48.1 : $(zipFile) : extracted-icu ] ; diff --git a/headers/os/locale/Collator.h b/headers/os/locale/Collator.h index 3b8c2fd8ad..6f818e68f6 100644 --- a/headers/os/locale/Collator.h +++ b/headers/os/locale/Collator.h @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Haiku, Inc. + * Copyright 2003-2011, Haiku, Inc. * Distributed under the terms of the MIT Licence. */ #ifndef _COLLATOR_H_ @@ -10,7 +10,7 @@ #include -namespace icu_44 { +namespace icu { class Collator; class RuleBasedCollator; }; @@ -75,7 +75,7 @@ public: private: status_t _SetStrength(int8 strength) const; - mutable icu_44::Collator* fICUCollator; + mutable icu::Collator* fICUCollator; int8 fDefaultStrength; bool fIgnorePunctuation; }; diff --git a/headers/os/locale/Country.h b/headers/os/locale/Country.h index 6488a1a973..e8e9c92a21 100644 --- a/headers/os/locale/Country.h +++ b/headers/os/locale/Country.h @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Haiku, Inc. + * Copyright 2003-2011, Haiku, Inc. * Distributed under the terms of the MIT Licence. */ #ifndef _COUNTRY_H_ @@ -16,7 +16,7 @@ class BBitmap; class BLanguage; class BMessage; -namespace icu_44 { +namespace icu { class DateFormat; class Locale; } @@ -45,7 +45,7 @@ public: private: friend class Private; - icu_44::Locale* fICULocale; + icu::Locale* fICULocale; }; diff --git a/headers/os/locale/DurationFormat.h b/headers/os/locale/DurationFormat.h index 0c8aa88a0b..46cda47ad5 100644 --- a/headers/os/locale/DurationFormat.h +++ b/headers/os/locale/DurationFormat.h @@ -1,5 +1,5 @@ /* - * Copyright 2010, Haiku, Inc. + * Copyright 2010-2011, Haiku, Inc. * Distributed under the terms of the MIT License. */ #ifndef _B_DURATION_FORMAT_H_ @@ -13,7 +13,7 @@ class BTimeZone; -namespace icu_44 { +namespace icu { class GregorianCalendar; } @@ -42,7 +42,7 @@ public: private: BString fSeparator; BTimeUnitFormat fTimeUnitFormat; - icu_44::GregorianCalendar* fCalendar; + icu::GregorianCalendar* fCalendar; }; diff --git a/headers/os/locale/FormattingConventions.h b/headers/os/locale/FormattingConventions.h index 035442993e..5c2e196da4 100644 --- a/headers/os/locale/FormattingConventions.h +++ b/headers/os/locale/FormattingConventions.h @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Haiku, Inc. + * Copyright 2003-2011, Haiku, Inc. * Distributed under the terms of the MIT Licence. */ #ifndef _FORMATTING_CONVENTIONS_H_ @@ -17,7 +17,7 @@ class BBitmap; class BLanguage; class BMessage; -namespace icu_44 { +namespace icu { class DateFormat; class Locale; } @@ -122,7 +122,7 @@ private: bool fUseStringsFromPreferredLanguage; - icu_44::Locale* fICULocale; + icu::Locale* fICULocale; }; diff --git a/headers/os/locale/Language.h b/headers/os/locale/Language.h index 15ac380e11..133e798c8f 100644 --- a/headers/os/locale/Language.h +++ b/headers/os/locale/Language.h @@ -15,7 +15,7 @@ class BBitmap; // We must not include the icu headers in there as it could mess up binary // compatibility. -namespace icu_44 { +namespace icu { class Locale; } @@ -64,7 +64,7 @@ private: friend class Private; uint8 fDirection; - icu_44::Locale* fICULocale; + icu::Locale* fICULocale; }; diff --git a/headers/os/locale/Locale.h b/headers/os/locale/Locale.h index 77b7c58a9d..7aad721312 100644 --- a/headers/os/locale/Locale.h +++ b/headers/os/locale/Locale.h @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Haiku, Inc. + * Copyright 2003-2011, Haiku, Inc. * Distributed under the terms of the MIT License. */ #ifndef _B_LOCALE_H_ @@ -12,7 +12,7 @@ #include -namespace icu_44 { +namespace icu { class DateFormat; } @@ -145,9 +145,9 @@ public: BString* sortKey) const; private: - icu_44::DateFormat* _CreateDateFormatter( + icu::DateFormat* _CreateDateFormatter( const BString& format) const; - icu_44::DateFormat* _CreateTimeFormatter( + icu::DateFormat* _CreateTimeFormatter( const BString& format) const; mutable BLocker fLock; diff --git a/headers/os/locale/TimeUnitFormat.h b/headers/os/locale/TimeUnitFormat.h index 8837bf90c4..92be2a833a 100644 --- a/headers/os/locale/TimeUnitFormat.h +++ b/headers/os/locale/TimeUnitFormat.h @@ -1,5 +1,5 @@ /* - * Copyright 2010, Haiku, Inc. + * Copyright 2010-2011, Haiku, Inc. * Distributed under the terms of the MIT License. */ #ifndef _B_TIME_UNIT_FORMAT_H_ @@ -12,7 +12,7 @@ class BString; -namespace icu_44 { +namespace icu { class TimeUnitFormat; } @@ -53,7 +53,7 @@ public: ) const; private: - icu_44::TimeUnitFormat* fFormatter; + icu::TimeUnitFormat* fFormatter; }; diff --git a/headers/os/locale/TimeZone.h b/headers/os/locale/TimeZone.h index 4fca971d05..28513d888b 100644 --- a/headers/os/locale/TimeZone.h +++ b/headers/os/locale/TimeZone.h @@ -1,5 +1,5 @@ /* - * Copyright 2010, Haiku, Inc. All rights reserved. + * Copyright 2010-2011, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _TIME_ZONE_H @@ -9,7 +9,7 @@ #include -namespace icu_44 { +namespace icu { class Locale; class TimeZone; } @@ -46,8 +46,8 @@ public: private: friend class Private; - icu_44::TimeZone* fICUTimeZone; - icu_44::Locale* fICULocale; + icu::TimeZone* fICUTimeZone; + icu::Locale* fICULocale; status_t fInitStatus; mutable uint32 fInitializedFields; diff --git a/headers/private/locale/FormattingConventionsPrivate.h b/headers/private/locale/FormattingConventionsPrivate.h index 881ac43031..9200c7b5ac 100644 --- a/headers/private/locale/FormattingConventionsPrivate.h +++ b/headers/private/locale/FormattingConventionsPrivate.h @@ -1,5 +1,5 @@ /* - * Copyright 2010, Oliver Tappe + * Copyright 2010-2011, Oliver Tappe * Distributed under the terms of the MIT License. */ #ifndef _FORMATTING_CONVENTIONS_PRIVATE_H @@ -23,7 +23,7 @@ public: fFormattingConventions = conventions; } - icu_44::Locale* + icu::Locale* ICULocale() { return fFormattingConventions->fICULocale; diff --git a/headers/private/locale/LanguagePrivate.h b/headers/private/locale/LanguagePrivate.h index bea1417755..7bdaf876b8 100644 --- a/headers/private/locale/LanguagePrivate.h +++ b/headers/private/locale/LanguagePrivate.h @@ -1,5 +1,5 @@ /* - * Copyright 2010, Oliver Tappe + * Copyright 2010-2011, Oliver Tappe * Distributed under the terms of the MIT License. */ #ifndef _LANGUAGE_PRIVATE_H @@ -23,7 +23,7 @@ public: fLanguage = language; } - icu_44::Locale* + icu::Locale* ICULocale() { return fLanguage->fICULocale; diff --git a/headers/private/locale/TimeZonePrivate.h b/headers/private/locale/TimeZonePrivate.h index a4ec4eb292..e6f6c1c317 100644 --- a/headers/private/locale/TimeZonePrivate.h +++ b/headers/private/locale/TimeZonePrivate.h @@ -1,5 +1,5 @@ /* - * Copyright 2010, Oliver Tappe + * Copyright 2010-2011, Oliver Tappe * Distributed under the terms of the MIT License. */ #ifndef _TIME_ZONE_PRIVATE_H @@ -23,7 +23,7 @@ public: fTimeZone = timeZone; } - icu_44::TimeZone* + icu::TimeZone* ICUTimeZone() { return fTimeZone->fICUTimeZone; diff --git a/src/kits/locale/Country.cpp b/src/kits/locale/Country.cpp index 235ed2bcd8..8b67c9e743 100644 --- a/src/kits/locale/Country.cpp +++ b/src/kits/locale/Country.cpp @@ -27,19 +27,16 @@ #include -#define ICU_VERSION icu_44 - - BCountry::BCountry(const char* countryCode) : - fICULocale(new ICU_VERSION::Locale("", countryCode)) + fICULocale(new icu::Locale("", countryCode)) { } BCountry::BCountry(const BCountry& other) : - fICULocale(new ICU_VERSION::Locale(*other.fICULocale)) + fICULocale(new icu::Locale(*other.fICULocale)) { } diff --git a/src/kits/locale/FormattingConventions.cpp b/src/kits/locale/FormattingConventions.cpp index a53c5c0a93..1df6952de6 100644 --- a/src/kits/locale/FormattingConventions.cpp +++ b/src/kits/locale/FormattingConventions.cpp @@ -1,7 +1,7 @@ /* * Copyright 2003-2009, Axel Dörfler, axeld@pinc-software.de. * Copyright 2009-2010, Adrien Destugues, pulkomandy@gmail.com. - * Copyright 2010, Oliver Tappe . + * Copyright 2010-2011, Oliver Tappe . * Distributed under the terms of the MIT License. */ @@ -32,9 +32,6 @@ #include -#define ICU_VERSION icu_44 - - // #pragma mark - helpers @@ -191,7 +188,7 @@ BFormattingConventions::BFormattingConventions(const char* id) fCachedUse24HourClock(CLOCK_HOURS_UNSET), fExplicitUse24HourClock(CLOCK_HOURS_UNSET), fUseStringsFromPreferredLanguage(false), - fICULocale(new ICU_VERSION::Locale(id)) + fICULocale(new icu::Locale(id)) { } @@ -206,7 +203,7 @@ BFormattingConventions::BFormattingConventions( fExplicitMonetaryFormat(other.fExplicitMonetaryFormat), fExplicitUse24HourClock(other.fExplicitUse24HourClock), fUseStringsFromPreferredLanguage(other.fUseStringsFromPreferredLanguage), - fICULocale(new ICU_VERSION::Locale(*other.fICULocale)) + fICULocale(new icu::Locale(*other.fICULocale)) { for (int s = 0; s < B_DATE_FORMAT_STYLE_COUNT; ++s) fCachedDateFormats[s] = other.fCachedDateFormats[s]; @@ -227,7 +224,7 @@ BFormattingConventions::BFormattingConventions(const BMessage* archive) { BString conventionsID; status_t status = archive->FindString("conventions", &conventionsID); - fICULocale = new ICU_VERSION::Locale(conventionsID); + fICULocale = new icu::Locale(conventionsID); for (int s = 0; s < B_DATE_FORMAT_STYLE_COUNT && status == B_OK; ++s) { BString format; diff --git a/src/kits/locale/Language.cpp b/src/kits/locale/Language.cpp index 919c0b7a8c..1b140c7f48 100644 --- a/src/kits/locale/Language.cpp +++ b/src/kits/locale/Language.cpp @@ -25,9 +25,6 @@ #include -#define ICU_VERSION icu_44 - - BLanguage::BLanguage() : fDirection(B_LEFT_TO_RIGHT), @@ -64,7 +61,7 @@ status_t BLanguage::SetTo(const char* language) { delete fICULocale; - fICULocale = new ICU_VERSION::Locale(language); + fICULocale = new icu::Locale(language); if (fICULocale == NULL) return B_NO_MEMORY; diff --git a/src/kits/locale/Locale.cpp b/src/kits/locale/Locale.cpp index 2b0208bed0..3ad0dfce80 100644 --- a/src/kits/locale/Locale.cpp +++ b/src/kits/locale/Locale.cpp @@ -1,6 +1,6 @@ /* ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. -** Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de. +** Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de. ** All rights reserved. Distributed under the terms of the OpenBeOS License. */ @@ -16,6 +16,8 @@ #include #include +#include + #include #include #include @@ -23,14 +25,10 @@ #include #include #include -#include #include -#define ICU_VERSION icu_44 - - using BPrivate::ObjectDeleter; using BPrivate::B_WEEK_START_MONDAY; using BPrivate::B_WEEK_START_SUNDAY; @@ -268,7 +266,7 @@ BLocale::FormatDate(BString* string, int*& fieldPositions, int& fieldCount, fieldPositions = NULL; UErrorCode error = U_ZERO_ERROR; - ICU_VERSION::FieldPositionIterator positionIterator; + icu::FieldPositionIterator positionIterator; UnicodeString icuString; dateFormatter->format((UDate)time * 1000, icuString, &positionIterator, error); @@ -276,7 +274,7 @@ BLocale::FormatDate(BString* string, int*& fieldPositions, int& fieldCount, if (error != U_ZERO_ERROR) return B_ERROR; - ICU_VERSION::FieldPosition field; + icu::FieldPosition field; std::vector fieldPosStorage; fieldCount = 0; while (positionIterator.next(field)) { @@ -315,7 +313,7 @@ BLocale::GetDateFields(BDateElement*& fields, int& fieldCount, fields = NULL; UErrorCode error = U_ZERO_ERROR; - ICU_VERSION::FieldPositionIterator positionIterator; + icu::FieldPositionIterator positionIterator; UnicodeString icuString; time_t now; dateFormatter->format((UDate)time(&now) * 1000, icuString, @@ -324,7 +322,7 @@ BLocale::GetDateFields(BDateElement*& fields, int& fieldCount, if (U_FAILURE(error)) return B_ERROR; - ICU_VERSION::FieldPosition field; + icu::FieldPosition field; std::vector fieldPosStorage; fieldCount = 0; while (positionIterator.next(field)) { @@ -534,7 +532,7 @@ BLocale::FormatTime(BString* string, int*& fieldPositions, int& fieldCount, fieldPositions = NULL; UErrorCode error = U_ZERO_ERROR; - ICU_VERSION::FieldPositionIterator positionIterator; + icu::FieldPositionIterator positionIterator; UnicodeString icuString; timeFormatter->format((UDate)time * 1000, icuString, &positionIterator, error); @@ -542,7 +540,7 @@ BLocale::FormatTime(BString* string, int*& fieldPositions, int& fieldCount, if (error != U_ZERO_ERROR) return B_ERROR; - ICU_VERSION::FieldPosition field; + icu::FieldPosition field; std::vector fieldPosStorage; fieldCount = 0; while (positionIterator.next(field)) { @@ -580,7 +578,7 @@ BLocale::GetTimeFields(BDateElement*& fields, int& fieldCount, fields = NULL; UErrorCode error = U_ZERO_ERROR; - ICU_VERSION::FieldPositionIterator positionIterator; + icu::FieldPositionIterator positionIterator; UnicodeString icuString; time_t now; timeFormatter->format((UDate)time(&now) * 1000, icuString, @@ -589,7 +587,7 @@ BLocale::GetTimeFields(BDateElement*& fields, int& fieldCount, if (error != U_ZERO_ERROR) return B_ERROR; - ICU_VERSION::FieldPosition field; + icu::FieldPosition field; std::vector fieldPosStorage; fieldCount = 0; while (positionIterator.next(field)) { @@ -651,7 +649,7 @@ BLocale::FormatNumber(BString* string, double value) const UErrorCode err = U_ZERO_ERROR; ObjectDeleter numberFormatter(NumberFormat::createInstance( *BFormattingConventions::Private(&fConventions).ICULocale(), - NumberFormat::kNumberStyle, err)); + UNUM_DECIMAL, err)); if (numberFormatter.Get() == NULL) return B_NO_MEMORY; @@ -691,7 +689,7 @@ BLocale::FormatNumber(BString* string, int32 value) const UErrorCode err = U_ZERO_ERROR; ObjectDeleter numberFormatter(NumberFormat::createInstance( *BFormattingConventions::Private(&fConventions).ICULocale(), - NumberFormat::kNumberStyle, err)); + UNUM_DECIMAL, err)); if (numberFormatter.Get() == NULL) return B_NO_MEMORY; diff --git a/src/preferences/time/ZoneView.cpp b/src/preferences/time/ZoneView.cpp index 065053cea5..d8b59e9eec 100644 --- a/src/preferences/time/ZoneView.cpp +++ b/src/preferences/time/ZoneView.cpp @@ -316,7 +316,7 @@ TimeZoneView::_BuildZoneMenu() BString region(zoneID, slashPos); - if (region == B_TRANSLATE("Etc")) + if (region == "Etc") region = kOtherRegion; else if (countryName.Length() == 0) { // skip global timezones from other regions, we are just @@ -324,7 +324,6 @@ TimeZoneView::_BuildZoneMenu() continue; } - // just accept timezones from "proper" regions, others are aliases ZoneItemMap::iterator regionIter = zoneMap.find(region); if (regionIter == zoneMap.end()) diff --git a/src/system/libroot/add-ons/icu/ICUNumericData.cpp b/src/system/libroot/add-ons/icu/ICUNumericData.cpp index 1612c99435..85bec2d9b2 100644 --- a/src/system/libroot/add-ons/icu/ICUNumericData.cpp +++ b/src/system/libroot/add-ons/icu/ICUNumericData.cpp @@ -44,8 +44,7 @@ ICUNumericData::SetTo(const Locale& locale, const char* posixLocaleName) if (result == B_OK) { UErrorCode icuStatus = U_ZERO_ERROR; DecimalFormat* numberFormat = dynamic_cast( - NumberFormat::createInstance(locale, DecimalFormat::kNumberStyle, - icuStatus)); + NumberFormat::createInstance(locale, UNUM_DECIMAL, icuStatus)); if (!U_SUCCESS(icuStatus)) return B_UNSUPPORTED; if (!numberFormat)