History log of /haiku/src/system/libroot/add-ons/icu/ICUTimeConversion.cpp
Revision Date Author Comments
# e8d32897 28-Oct-2023 Augustin Cavalier <waddlesplash@gmail.com>

ICUTimeConversion: Fix buffer overflows and add more error handling.

* Declare databridge buffer lengths in LocaleBackend.
* Use strcpy instead of strlcpy when writing to databridge buffers
(this is the first fix for #18598.)
* Check for overflows and error out when they happen.
* Verify that ICU actually knows the timezone in question
and fall back to GMT if it does not (this would also fix that crash.)

Fixes #18598.


# d338200e 30-May-2022 Trung Nguyen <trungnt282910@gmail.com>

libs/posix: Implemented new locale functions

Implemented the missing POSIX functions in <locale.h>:
newlocale, duplocale, uselocale, and freelocale, and also
provided missing type definitions for <locale.h>.

Implemented missing POSIX locale-based function variants.

Modified LocaleBackend so that it could support thread-local
locales.

Some glibc-like locale-related variables supporting
ctype and printf family of functions have also been updated
to reflect the thread-local variables present in the latest
glibc sources.

As there have been some modifications to global symbols
in libroot, libroot_stubs.c has been regenerated.

Bug: #17168
Change-Id: Ibf296c58c47d42d1d1dfb2ce64042442f2679431
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5351
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# c1e6e51a 20-Feb-2021 Jérôme Duval <jerome.duval@gmail.com>

libroot: implement timegm calling the ICU backend

Change-Id: Ib4de4288e061670acbc2edea3671cee029305d33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3748
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# 1bad1ff3 02-Aug-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Prepare for ICU update

- libicule and libiculx do not exist anymore in newer ICU versions
(harfbuzz replaces them), but we didn't actually use them, so remove
them from the build feature and from the package dependencies
- Add namespace usage marcos since the newer ICU packages put ICU things
in a namespace, making it easier to have multiple versions of ICU used
side by side.

No functional change intended, but this makes it possible to build the
code with either ICU 57 (for gcc2) or 66 (for other architectures).


# 3aeed660 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949


# ec17468f 23-Feb-2012 Oliver Tappe <zooey@hirschkaefer.de>

Allow switching of timezone string to messages locale, too.

* adjust POSIX locale backend to redirect the timezone string
through the messages/time-locale indirection


# bd55dcbe 07-Jan-2012 Oliver Tappe <zooey@hirschkaefer.de>

Add our implementation for wcscoll() and wcsxfrm().

* add Wcscoll() and Wcsxfrm() ICU locale backend
* provide implementations of wcscoll() and wcsxfrm() that are using
the respective methods of the locale backend


# f4995c13 27-Dec-2011 Oliver Tappe <zooey@hirschkaefer.de>

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.


# c894d186 23-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Bring rewritten multibyte-support into repository.

* update copyrights of locale backend files

Multibyte-support has been rewritten to use ICU as backend.
While this does not necessarily work properly in every aspect
(e.g. the shell still has [different] problems with multibyte-
characters now), it does fix #6263 and #7700.


# e8226ce4 02-Mar-2011 Oliver Tappe <zooey@hirschkaefer.de>

* fix support for influencing tzset() via TZ environment variable
(now at least <std> and <offset> are supported properly)
* instead of creating a TimeZone object whenever needed, we now
create it in tzset() and keep it around
* add tests for TZ to locale_test

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40788 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 25dc253d 22-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Merged weak-symbols branch.
* Fixed trivial merge conflict in src/system/libroot/posix/locale/nl_langinfo.cpp
* Fixed gcc 2 compilation of src/system/glue/init_term_dyn.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39571 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de2e54ac 12-Nov-2010 Oliver Tappe <zooey@hirschkaefer.de>

Adjust tzset() implementation to better follow the POSIX specs and
make some more perl tests happy.
* no longer expect a ICU timezone ID in the TZ environment variable,
but only expect this format if the TZ-value is starting with ':'
* accept "standard" TZ-values like "EST5" (of which only "EST" is
relevant to us) - if such a value is specified, we hardcode the
timezone name to the given value, no matter how ICU calls it
* adjust tests accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39415 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ccee6057 11-Sep-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fix wrong signedness in values put into global 'timezone' variable,
the POSIX specs are a bit vague on this (to say the least)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38606 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 560b10ff 16-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Implement tzset(), gmtime(), localtime() and mktime() on top of ICU
* no longer keep a separate time-backend, since the implementation needs to
access (data of) the locale backend anyway
* moved more stuff from localtime_fading_out.c to localtime.cpp
* added respective tests to locale_test
* added two more tests copied from glibc, test_time.c and tst-mktime.c


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38162 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3aeed6607cd07762c0e709633c012b3a632dbad9 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949


# ec17468f637517fb3c9db59d3ab555e8cbe126c1 23-Feb-2012 Oliver Tappe <zooey@hirschkaefer.de>

Allow switching of timezone string to messages locale, too.

* adjust POSIX locale backend to redirect the timezone string
through the messages/time-locale indirection


# bd55dcbefbf303b990bbc118370f2325fe064cc2 07-Jan-2012 Oliver Tappe <zooey@hirschkaefer.de>

Add our implementation for wcscoll() and wcsxfrm().

* add Wcscoll() and Wcsxfrm() ICU locale backend
* provide implementations of wcscoll() and wcsxfrm() that are using
the respective methods of the locale backend


# f4995c1381cf183acb3cd4e3aff7381b7256d11a 27-Dec-2011 Oliver Tappe <zooey@hirschkaefer.de>

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.


# c894d1868ef1d23e5536bfdbd8608402cef14607 23-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Bring rewritten multibyte-support into repository.

* update copyrights of locale backend files

Multibyte-support has been rewritten to use ICU as backend.
While this does not necessarily work properly in every aspect
(e.g. the shell still has [different] problems with multibyte-
characters now), it does fix #6263 and #7700.


# e8226ce48d295aa227b3faea3f43747c77604f58 02-Mar-2011 Oliver Tappe <zooey@hirschkaefer.de>

* fix support for influencing tzset() via TZ environment variable
(now at least <std> and <offset> are supported properly)
* instead of creating a TimeZone object whenever needed, we now
create it in tzset() and keep it around
* add tests for TZ to locale_test

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40788 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 25dc253d6ab28ce204fa4de2d3e7a27d167fc817 22-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Merged weak-symbols branch.
* Fixed trivial merge conflict in src/system/libroot/posix/locale/nl_langinfo.cpp
* Fixed gcc 2 compilation of src/system/glue/init_term_dyn.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39571 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de2e54ace0213b150fb13d9b740e92f4c1433a06 12-Nov-2010 Oliver Tappe <zooey@hirschkaefer.de>

Adjust tzset() implementation to better follow the POSIX specs and
make some more perl tests happy.
* no longer expect a ICU timezone ID in the TZ environment variable,
but only expect this format if the TZ-value is starting with ':'
* accept "standard" TZ-values like "EST5" (of which only "EST" is
relevant to us) - if such a value is specified, we hardcode the
timezone name to the given value, no matter how ICU calls it
* adjust tests accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39415 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ccee6057f0503616ecb84900d0933de0846c2c4a 11-Sep-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fix wrong signedness in values put into global 'timezone' variable,
the POSIX specs are a bit vague on this (to say the least)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38606 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 560b10ff88d306ac6e6f8f76eafc61df94f941d6 16-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Implement tzset(), gmtime(), localtime() and mktime() on top of ICU
* no longer keep a separate time-backend, since the implementation needs to
access (data of) the locale backend anyway
* moved more stuff from localtime_fading_out.c to localtime.cpp
* added respective tests to locale_test
* added two more tests copied from glibc, test_time.c and tst-mktime.c


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38162 a95241bf-73f2-0310-859d-f6bbb57e9c96