summaryrefslogtreecommitdiff
path: root/lib/libc/locale
AgeCommit message (Collapse)Author
2013-11-12ANSI prototypeTheo de Raadt
2013-08-28Allow setlocale(LC_MESSAGES, ...); to succeed. This always returned anStefan Sperling
error, but that makes some ports (e.g. GNOME) freak out. We can allow any message language to be used as long as the encoding specified as part of the locale name is supported (i.e. listed in locale -m output). The primary users of LC_MESSAGES are catopen(3) and gettext(3), which already worked without this change. ok ajacoutot, naddy, matthew
2013-08-28oops, we forgot to remove the .El in previous; sorry stefan (though youJason McIntyre
should have run this through mandoc -Tlint ;)
2013-08-28Cosmetic tweaks of wcrtomb(3) RETURN VALUES section. ok jmcStefan Sperling
2013-08-14no longer any need to quote macro lines with >9 args;Jason McIntyre
From: Jan Stary
2013-06-05Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarzeTed Unangst
2013-06-02Fix wcsto{f,d,ld}() C99 compliance to now correctlyMatthew Dempsky
1. handle "inf", "infinity", "nan", and "nan(whatever)", 2. reject bare minus and plus signs, 3. handle multi-byte characters, and 4. set *endptr = nptr for all failure cases. Fixes libc++'s test cases for std::sto{f,d,ld}(). ok stsp
2013-06-01Change the naming scheme used for directories in /usr/share/locale toStefan Sperling
eliminate redundant copies of LC_CTYPE files. Instead of names using "language_territory.codeset" permutations, use just the codeset component to name directories storing LC_CTYPE files. Suggested by bluhm@ while discussing the idea of using symlinks in /usr/share/locale like FreeBSD does. Future locale features which store language and/or territory specific data can name directories after language or territory names.
2013-05-30Sort includes. From Vladimir Tamara Patino <vtamara@pasosdeJesus.org>Stefan Sperling
2013-05-03Fix resetting MB_CUR_MAX when switching locales away from a UTF-8 locale.Stefan Sperling
Patch by Vladimir Támara Patiño <vtamara@pasosdeJesus.org> ok mpi millert
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-08-14remove unused variableCharles Longeau
ok matthew@
2012-06-07Document mbsnrtowcs() and wcsnrtombs().Matthew Dempsky
ok jmc
2012-06-06Add support for mbsnrtowcs() and wcsnrtombs() to libc.Matthew Dempsky
Bulk build test by naddy.
2011-11-16Fix mbstowcs return value documentation. New text based on mbsrtowcs page.Stefan Sperling
ok jmc
2011-10-09d_t_fmt: fix the format for the day of the month to use %e (singleAntoine Jacoutot
digits are preceded by a blank instead of a 0) and not %d (POSIX). ok jasper@ guenther@
2011-04-29Add BUGS section explaining that these functions do not cover the entireStefan Sperling
Unicode character set in a UTF-8 locale and can therefore return wrong answers.
2011-04-15wcwidth() must return -1 if the character is not printable.Stefan Sperling
Diff from Alexander Polakov. OK phessler@
2011-04-03Don't fill the ctype tab with Latin-1 information in UTF-8 locales.Stefan Sperling
Single byte sequences other than ASCII are not valid UTF-8, so they should test false in single-byte ctype functions like isprint(). Remove some dead #ifdef'd code while here. ok phessler nicm mikeb
2011-04-03Add wcwidth(3) man page. ok nicmStefan Sperling
2011-03-16nl_types.h doesn't need to be #included to use nl_langinfo(). PointedPhilip Guenthe
out by Andres Perera (andres.p at zoho.com)
2011-03-15Remove evaluation of PATH_LOCALE environment variable because it can beStefan Sperling
abused to cause an integer overflow and serves no real purpose. Found by Alexander Schrijver. ok millert deraadt
2011-03-13Sync ctype definitions for the UTF-8 locale to FreeBSD, fixing width ofStefan Sperling
various zero-width characters (e.g. diacritical marks). Also fix runetype mask definitions so that mklocale interprets zero width properly. Diff from Alexander Polakov. Character definition changes checked against Unicode 5.2 by me. ok matthew nicm
2011-03-09Stilistic improvement: use clean mdoc(7) .Qq enclosures rather thanIngo Schwarze
(correct, but ugly) low-level roff(7) quoting of quote characters. As a side effect, this avoids ugly formatting caused by a nasty mandoc(1) bug with roff(7) quoting in mdoc(7) documents. Of course, that bug will ultimately get fixed as well, but that can't be done quickly. Reported by Tim van der Molen <tbvdm at xs4all dot nl> ok jmc@
2010-12-05Rewrite the mbrtowc(3) man page so we can make sense of this function.Stefan Sperling
tweaks from jmc, help from uwe, "We are going to have to trust you :-)" deraadt
2010-11-20Add CAVEATS section documenting error handling caveats.Stefan Sperling
tweak and ok jmc, tedu
2010-09-10observe the following spelling:Jason McIntyre
- wide character (noun) - wide-character (adjective) this is the "fix of least resistance", and appears to be in line with posix style; a tiny fix still needed for curses, but i'll mail that upstream;
2010-07-27Replace the single-byte placeholders for the multi-byte/wide-characterStefan Sperling
conversion interfaces of libc (mbrtowc(3) and friends) with new implementations that internally call an API based on NetBSD's citrus. This allows us to support locales with multi-byte character encodings. Provide two implementations of the citrus-based API: one based on the old single-byte placeholders for use with our existing single-byte character locales (C, ISO8859-*, KOI8, CP1251, etc.), and one that provides support for UTF-8 encoded characters (code based on FreeBSD's implementation). Install the en_US.UTF-8 ctype locale support file, and allow the UTF-8 ctype locale to be enabled via setlocale(3) (export LC_CTYPE='en_US.UTF-8'). A lot of programs, especially from ports, will now start using UTF-8 if the UTF-8 locale is enabled. Use at your own risk, and please report any breakage. Note that ncurses-based programs cannot display UTF-8 right now, this is being worked on. To prevent install media growth, add vfprintf(3) and mbrtowc(3) to libstubs. The mbrtowc stub was copied unchanged from its old single-byte placeholder. vfprintf.c doesn't need to be copied, just put in .PATH (hint by fgsch@). Testing by myself, naddy, sthen, nicm, espie, armani, Dmitrij D. Czarkoff. ok matthieu espie millert sthen nicm deraadt
2010-03-26dispense with some wacky escape sequences;Jason McIntyre
2010-02-03Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentMiod Vallat
files or directories when applicable. The inspiration and name of MACHINE_CPU come from NetBSD, although the way to provide it to Makefiles is completely different. ok kettenis@
2009-11-09mbrlen returns size_t not int.Nicholas Marriott
ok espie
2009-01-13Man page for wcstof(3), wcstod(3) and wcstold(3).Mark Kettenis
2009-01-13Add wcstof(3) and wcstold(3).Mark Kettenis
ok miod@
2009-01-13Add wcstoimax(3) and wcstoumax(3).Mark Kettenis
ok miod@
2008-12-20Add man page for wcstol and friends.Mark Kettenis
ok jmc@
2008-10-05Fix conversion of numbers without an exponent.Mark Kettenis
ok martynas@
2008-08-23make mbstowcs(NULL, string, 0) correctly return the length of theDamien Miller
wchar_t string needed to represent "string", which in our case is just strlen(string); feedback & "looks right" deraadt@
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2007-11-28remove unused functionCharles Longeau
ok otto@
2007-10-08attribute packed -> __packedGilles Chehade
OK millert
2007-09-17Check snprintf(3) return value for error or truncation.Moritz Jodeit
Mostly path construction, where truncation could be bad. ok and input from deraadt@ millert@ ray@
2007-09-06_xpg4_setrunelocale() returns an errno(2) value in the failureMoritz Jodeit
case and 0 if the locale was found. So checking against -1 makes no sense. ok millert@
2007-05-31convert to new .Dd format;Jason McIntyre
2007-02-09grammar;Jason McIntyre
2006-07-04fix prototype of wcstombs; from TAKAHASHI TamotsuOtto Moerbeek
2006-04-02malloc(x * y) -> calloc(x, y) from adobriyan AT gmail.com, with tweaksDamien Miller
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
2005-12-10because lint says so; ok espieTheo de Raadt
2005-11-27Add a cast for (size_t)-1 because we know what we're doing, the ISO std.Chad Loder
says this is what we're supposed to return. Makes lint happy. OK deraadt, espie
2005-11-16CODESET support. okay millert@, otto@Marc Espie
(not really useful for now, it mostly helps some programs which want to use it, it will become useful when we have full 16 bits locale).
2005-10-20A library should not return EFAULT. Just segfault if a bogus orOtto Moerbeek
NULL pointer is passed in. ok espie@