Commit Graph

21 Commits

Author SHA1 Message Date
waddlesplash 3f9e3b0a62 ICU locale backend: Increase size of fLocaleDescription from 512 to 1024 bytes.
GCC7 gave a Werror that we were snprintf'ing potentially ~860 bytes into
a 512-byte buffer.
2018-05-19 20:44:51 -04:00
Oliver Tappe ec17468f63 Allow switching of timezone string to messages locale, too.
* adjust POSIX locale backend to redirect the timezone string
  through the messages/time-locale indirection
2012-02-23 23:15:36 +01:00
Oliver Tappe 1e1278f46f Implement taking date strings from messages locale.
* mimic LocaleKit and add option to POSIX locale backend for taking
  the date strings from the messages locale (instead of time locale)
2012-02-23 23:15:36 +01:00
Oliver Tappe bd55dcbefb 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
2012-01-07 21:47:31 +01:00
Oliver Tappe ec99f3b2a6 Adjust mbstate_t to embed the state of the ICU converter.
* make room in mbstate_t for containing an ICU-converter's state
  (well, in fact the whole converter object)
* adjust libroot's locale add-on to clone converters into a given
  mbstate_t directly
* adjust ICUThreadLocalStorageValue to contain the converter pointer
  instead of a converter-ID (if the converter is related to an
  mbstate_t, it points into the mbstate_t).
* adjust users of converters to directly use converter pointers
  instead of ICUConverterRef
* drop now unused ICUConverterManager and ICUConverterRef
* update gcc4 optional package

This brings our multibyte implementation into a fully working state,
both non-ascii and non-8-bit characters can now be handled normally
in the Terminal, i.e. this finally fixes #6276.

N.B.: Since the size of mbstate_t has changed, everything (including
the compiler!) needs to be rebuilt.
2011-12-15 13:18:11 +01:00
Oliver Tappe 995d6d827f Implement our own version of wcsrtombs().
* add WcharStringToMultibyte() to libroot's locale backend
* implement wcstombs(), wcsrtombs() and wcsnrtombs() on top of that
  new backend function
2011-12-12 17:27:42 +01:00
Oliver Tappe 73186b2fcd Add implementation of mbsrtowcs() to our locale backend.
* add MultibyteStringToWchar() to ICU locale backend
* implement mbsrtowcs() and mbsnrtowcs() on top of 
  MultibyteStringToWchar()
* drop respective glibc files
2011-12-12 17:27:41 +01:00
Oliver Tappe c894d1868e 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.
2011-11-23 19:55:34 +01:00
Oliver Tappe 28ae43d033 Add multibyte-support to ctype-locale backend.
* add actual converter methods MultibyteToWchar() and WcharToMultibyte()
  to locale backend and implement them in the ctype subpart
* add management code for maintaining converters referenced by mbstate_t
2011-11-22 18:17:58 +01:00
Oliver Tappe e0eb1d38c4 Let MB_CUR_LEN lookup the actual value.
* instead of yielding 1, MB_CUR_LEN now looks up the correct
  value in the ctype data provided by the locale backend
2011-11-22 17:32:39 +01:00
Oliver Tappe bf5ff48092 Use TLS and converter manager in locale backend. 2011-11-22 17:17:18 +01:00
Oliver Tappe bcadc4ca66 Start work on multibyte-support in locale backend.
* add ICUThreadLocaleStorageValue, which will be used to maintain
  per-thread ICU converters
* add ICUConverterManager
2011-11-22 16:55:39 +01:00
Oliver Tappe e8226ce48d * 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
2011-03-03 00:34:51 +00:00
Ingo Weinhold 25dc253d6a * 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
2010-11-22 13:06:36 +00:00
Oliver Tappe de2e54ace0 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
2010-11-13 01:13:38 +00:00
Oliver Tappe 6a5dacaa3c part1 of fixing #6599:
* protect against invocations of ctype-macros/-functions with negative
  character indices by mirroring the corresponding values at negative
  array indices (the legal access range of __ctype_b is now [-128..255])


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-18 15:55:42 +00:00
Oliver Tappe 86932f41cc Try to fix #6581:
* avoid trying to overwrite values of a constant structure when
  updating the numeric locale data values used by glibc


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-12 17:24:38 +00:00
Oliver Tappe dbe1e23aa8 Optimised passing around of timezone a bit
* _kern_[sg]et_timezone() now accepts/passes out the timezone name, too
* adjust Time preflet and clockconfig to pass the timezone name into the kernel
  when calling _kern_set_timezone()
* ajust implementation of tzset() to fetch the timezone name from the kernel
  via _kern_get_timezone() instead of reading 'libroot_timezone_info'
* the Time preflet no longer writes 'libroot_timezone_info'


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38164 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-16 22:01:28 +00:00
Oliver Tappe 560b10ff88 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
2010-08-16 21:14:23 +00:00
Oliver Tappe a4823efd7d Fix problems with sed and gcc caused by reintegration of posix-locale:
* support invocation of ctype/wctype macros with EOF/WEOF (-1), which would
  access more or less random memory before - I don't know why this worked
  more or less reliably for the POSIX locale, but it didn't for any other


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-24 16:20:52 +00:00
Oliver Tappe a3f665982e * reintegrated posix-locale
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37725 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 23:13:00 +00:00