| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Link localeconv(3) to localeconv_l(3)
|
|
|
|
|
|
|
|
|
| |
Per rfc3629 value greater than 0x10ffff should be rejected (r286490,r286491)
Make UTF-8 parsing and generation more strict. (r287125 by ed)
- in mbrtowc() we need to disallow codepoints above 0x10ffff.
- In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.
|
|
|
|
|
|
|
|
| |
Fix an issue where the locale and rune locale could become out of sync,
causing mb* functions (and similar) to be called with the wrong data
(possibly a null pointer, causing a crash).
PR: standards/188036
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix incorrect type of "invalids" argument in __iconv() prototype.
MFC r281550,281591:
Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
Adjust all code that calls iconv.
PR: 199099
|
|
|
|
|
|
|
|
|
|
|
| |
minor perf enhancement for UTF-8
Reduce some duplicate code.
Reference:
https://www.illumos.org/issues/628
Obtained from: Illumos
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
citrus: Avoid invalid code points.
The UTF-8 decoder should not accept byte sequences which decode to
unicode code positions U+D800 to U+DFFF (UTF-16 surrogates).[1]
Contrary to the original OpenBSD patch, we do pass U+FFFE and U+FFFF,
both values are valid "non-characters" [2] and must be mapped through
UTFs.
[1] http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
[2] http://www.unicode.org/faq/private_use.html
Reported by: Stefan Sperling [1]
Thanks to: jilles [2]
Obtained from: OpenBSD
|
|
|
|
|
|
| |
a macro with parameters. Remove a __DECONST hack and add consts instead
for gnu libiconv API compatability. This makes it work with things like
devel/boost-libs that expects to use "iconv" as though it were a pointer.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I initially thought wchar_t was locale independent, but this seems to be
only the case on Linux. This means that we cannot depend on the *wc*()
routines to implement *c16*() and *c32*(). Instead, use the Citrus
libiconv that is part of libc.
I'll see if there is anything I can do to make the existing functions
somewhat useful in case the system is built without libiconv in the
nearby future. If not, I'll simply remove the broken implementations.
Reviewed by: jilles, gabor
|
|
|
|
|
|
|
|
|
|
|
|
| |
The <uchar.h> header, part of C11, adds a small number of utility
functions for 16/32-bit "universal" characters, which may or may not be
UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight
wrappers around wcrtomb() and mbrtowc().
While there, also add (non-yet-standard) _l functions, similar to the
ones we already have for the other locale-dependent functions.
Reviewed by: theraven
|
|
|
|
| |
MFC after: 1 week
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
querylocale is not part of IEEE Std 1003.1-2008.
MFC after: 3 days
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
| |
These are obtained via fopen().
|
| |
|
|
|
|
|
|
|
|
|
| |
This fixes a race condition where another thread may fork() before CLOEXEC
is set, unintentionally passing the descriptor to the child process.
This commit only adds O_CLOEXEC flags to open() or openat() calls where no
fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still
leaves a race window so it should be fixed later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- lib/libc/locale/islower.3
- lib/libc/locale/ispunct.3
- lib/libc/locale/nl_langinfo.3
- lib/libc/locale/isgraph.3
- lib/libc/locale/isspace.3
Reviewed by: bz
Approved by: theraven
MFC after: 5 days
|
|
|
|
| |
while here.
|
|
|
|
|
|
|
|
| |
wctype.h, iswalnum_l(3). Add it and its functions to the Makefile.
Reviewed by: gavin, jilles
Approved by: theraven
MFC after: 5 days
|
|
|
|
|
|
| |
xlocale refactoring.
MFC after: 1 week
|
|
|
|
|
|
|
| |
The function isascii_l() is not in POSIX even though isascii() is,
probably because isascii() is marked as obsolete. The other functions,
like digittoint_l() and ishexnumber_l(), are FreeBSD-specific just like
their non-_l versions.
|
|
|
|
| |
Reported by: mm
|
|
|
|
|
|
| |
PR: 167734
Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after: 3 days
|
|
|
|
| |
Submitted by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
|
|
|
|
| |
Reported by: das
|
| |
|
|
|
|
|
|
|
| |
quotation. Also make sure we have the same amount of columns in each row as
the number of columns we specify in the head arguments.
Reviewed by: brueffer
|
|
|
|
|
|
|
| |
Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
debug mode (without optimisations) it doesn't generate a linker failure.
Approved by: dim (mentor)
|
|
|
|
| |
Approved by: dim (mentor)
|
|
|
|
| |
Approved by: dim (mentor)
|
|
|
|
|
|
| |
of __getCurrentRuneLocale().
Pointy hat to: me
|
|
|
|
| |
Approved by: dim (mentor)
|
|
|
|
|
|
| |
universe with gcc.
Approved by: dim (mentor)
|
|
|
|
|
|
| |
universe with them. Sorry for the breakage.
Pointy hat to: me and brooks
|
|
|
|
|
|
| |
consistency.
Approved by: brooks (mentor)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Address performance regressions encountered by das@ by caching per-thread
data in TLS where available.
- Add a __NO_TLS flag to cdefs.h to indicate where not available.
- Reorganise the xlocale.h definitions into xlocale/*.h so that they can be
included from multiple places.
- Export the POSIX2008 subset of xlocale when POSIX2008 says it should be
exported, independently of whether xlocale.h is included.
- Fix the bug where programs using ctype functions always assumed ASCII unless
recompiled.
- Fix some style(9) violations.
Reviewed by: brooks (mentor)
Approved by: dim (mentor)
|
|
|
|
|
| |
Noticed by: Zhihao Yuan <lichray gmail com>
MFC after: 1 week
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
locale components.
Reported by: Michael Butler
Approved by: dim (mentor)
|