[haiku-commits] haiku: hrev43564 - in src: kits/locale tests/system/libroot/posix system/libroot/add-ons/icu

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 27 Dec 2011 14:16:50 +0100 (CET)

hrev43564 adds 3 changesets to branch 'master'
old head: 83cbfa5e0ed77815e6a6bbc1ad2860e6ba4f9b99
new head: 9cb0187a4ff4222a3e317a6acd4cd18d76ab1cab

----------------------------------------------------------------------------

f4995c1: Improve timezone names returned by POSIX functions.
  
  * Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
    the former yields more appropriate (textual) values. Strangely enough,
    it used to be the other way around, which is why we didn't used SHORT
    in the past.

d68d73f: Improve timezone names returned by BTimeZone.
  
  * Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
    the former yields more appropriate (textual) values. Strangely enough,
    it used to be the other way around, which is why we didn't used SHORT
    in the past.

9cb0187: Adjust locale_test expectations to current ICU-data.

                                    [ Oliver Tappe <zooey@xxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 13 insertions(+), 15 deletions(-)
src/kits/locale/TimeZone.cpp                       |   14 ++++++--------
.../libroot/add-ons/icu/ICUTimeConversion.cpp      |    2 +-
src/tests/system/libroot/posix/locale_test.cpp     |   12 ++++++------

############################################################################

Commit:      f4995c1381cf183acb3cd4e3aff7381b7256d11a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f4995c1
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Tue Dec 27 13:14:55 2011 UTC

Improve timezone names returned by POSIX functions.

* Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
  the former yields more appropriate (textual) values. Strangely enough,
  it used to be the other way around, which is why we didn't used SHORT
  in the past.

----------------------------------------------------------------------------

diff --git a/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp 
b/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp
index 01a0250..a676033 100644
--- a/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp
+++ b/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp
@@ -124,7 +124,7 @@ ICUTimeConversion::TZSet(const char* timeZoneID, const 
char* tz)
                        strcpy(fDataBridge->addrOfTZName[0], fTimeZoneID);
                } else {
                        UnicodeString icuString;
-                       fTimeZone->getDisplayName(i == 1, 
TimeZone::SHORT_COMMONLY_USED,
+                       fTimeZone->getDisplayName(i == 1, TimeZone::SHORT,
                                fTimeData.ICULocale(), icuString);
                        CheckedArrayByteSink 
byteSink(fDataBridge->addrOfTZName[i],
                                sizeof(fTimeZoneID));

############################################################################

Commit:      d68d73f7a65db43334de0c301ac524d375c666a8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d68d73f
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Tue Dec 27 13:15:21 2011 UTC

Improve timezone names returned by BTimeZone.

* Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
  the former yields more appropriate (textual) values. Strangely enough,
  it used to be the other way around, which is why we didn't used SHORT
  in the past.

----------------------------------------------------------------------------

diff --git a/src/kits/locale/TimeZone.cpp b/src/kits/locale/TimeZone.cpp
index 98293ba..86258e3 100644
--- a/src/kits/locale/TimeZone.cpp
+++ b/src/kits/locale/TimeZone.cpp
@@ -153,11 +153,10 @@ BTimeZone::ShortName() const
        if ((fInitializedFields & skShortNameField) == 0) {
                UnicodeString unicodeString;
                if (fICULocale != NULL) {
-                       fICUTimeZone->getDisplayName(false, 
TimeZone::SHORT_COMMONLY_USED,
-                               *fICULocale, unicodeString);
-               } else {
-                       fICUTimeZone->getDisplayName(false, 
TimeZone::SHORT_COMMONLY_USED,
+                       fICUTimeZone->getDisplayName(false, TimeZone::SHORT, 
*fICULocale,
                                unicodeString);
+               } else {
+                       fICUTimeZone->getDisplayName(false, TimeZone::SHORT, 
unicodeString);
                }
                BStringByteSink sink(&fShortName);
                unicodeString.toUTF8(sink);
@@ -174,11 +173,10 @@ BTimeZone::ShortDaylightSavingName() const
        if ((fInitializedFields & skShortDaylightSavingNameField) == 0) {
                UnicodeString unicodeString;
                if (fICULocale != NULL) {
-                       fICUTimeZone->getDisplayName(true, 
TimeZone::SHORT_COMMONLY_USED,
-                               *fICULocale, unicodeString);
-               } else {
-                       fICUTimeZone->getDisplayName(true, 
TimeZone::SHORT_COMMONLY_USED,
+                       fICUTimeZone->getDisplayName(true, TimeZone::SHORT, 
*fICULocale,
                                unicodeString);
+               } else {
+                       fICUTimeZone->getDisplayName(true, TimeZone::SHORT, 
unicodeString);
                }
                BStringByteSink sink(&fShortDaylightSavingName);
                unicodeString.toUTF8(sink);

############################################################################

Revision:    hrev43564
Commit:      9cb0187a4ff4222a3e317a6acd4cd18d76ab1cab
URL:         http://cgit.haiku-os.org/haiku/commit/?id=9cb0187
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Tue Dec 27 13:16:16 2011 UTC

Adjust locale_test expectations to current ICU-data.

----------------------------------------------------------------------------

diff --git a/src/tests/system/libroot/posix/locale_test.cpp 
b/src/tests/system/libroot/posix/locale_test.cpp
index d4b12c9..050c566 100644
--- a/src/tests/system/libroot/posix/locale_test.cpp
+++ b/src/tests/system/libroot/posix/locale_test.cpp
@@ -410,7 +410,7 @@ test_localeconv()
                (char*)",",
                (char*)"\x03\x02",
                (char*)"INR ",
-               (char*)"રુ",
+               (char*)"\xE2\x82\xB9",
                (char*)".",
                (char*)",",
                (char*)"\x03\x02",
@@ -631,7 +631,7 @@ test_strftime()
        test_strftime("nl_NL", strftime_nl);
 
        const strftime_data strftime_nb[] = {
-               { "%c", "lørdag 17. juli 2010 kl. 18:26:09 GMT" },
+               { "%c", "kl. 18:26:09 GMT lørdag 17. juli 2010" },
                { "%x", "17. juli 2010" },
                { "%X", "18:26:09" },
                { "%a", "lør." },
@@ -1808,7 +1808,7 @@ test_mktime(const char* tz, tm& tm, time_t expected, int 
expectedWeekDay,
 void
 test_timeconversions()
 {
-       setlocale(LC_ALL, "");
+       setlocale(LC_ALL, "en_US");
        {
                time_t testTime = 1279391169;   // Sat Jul 17 18:26:09 GMT 2010
                tm gtm = {
@@ -1866,7 +1866,7 @@ test_timeconversions()
                test_mktime(":America/Los_Angeles", latm, testTime, 6, 197);
 
                tm ttm = {
-                       9, 26, 3, 18, 6, 110, 0, 198, 0, 9 * 3600, (char*)"JST"
+                       9, 26, 3, 18, 6, 110, 0, 198, 0, 9 * 3600, 
(char*)"GMT+09:00"
                };
                test_localtime(":Asia/Tokyo", testTime, ttm);
                test_gmtime(":Asia/Tokyo", testTime, gtm);
@@ -1914,7 +1914,7 @@ test_timeconversions()
                test_mktime(":America/Los_Angeles", latm, testTime, 2, 67);
 
                tm ttm = {
-                       9, 26, 3, 10, 2, 110, 3, 68, 0, 9 * 3600, (char*)"JST"
+                       9, 26, 3, 10, 2, 110, 3, 68, 0, 9 * 3600, 
(char*)"GMT+09:00"
                };
                test_localtime(":Asia/Tokyo", testTime, ttm);
                test_gmtime(":Asia/Tokyo", testTime, gtm);
@@ -1962,7 +1962,7 @@ test_timeconversions()
                test_mktime(":America/Los_Angeles", latm, testTime, 3, 364);
 
                tm ttm = {
-                       0, 0, 9, 1, 0, 70, 4, 0, 0, 9 * 3600, (char*)"JST"
+                       0, 0, 9, 1, 0, 70, 4, 0, 0, 9 * 3600, (char*)"GMT+09:00"
                };
                test_localtime(":Asia/Tokyo", testTime, ttm);
                test_gmtime(":Asia/Tokyo", testTime, gtm);


Other related posts:

  • » [haiku-commits] haiku: hrev43564 - in src: kits/locale tests/system/libroot/posix system/libroot/add-ons/icu - zooey