This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Find utf8-8 locales reliably on C99 platforms
authorKarl Williamson <public@khwilliamson.com>
Tue, 21 Jan 2014 23:25:42 +0000 (16:25 -0700)
committerKarl Williamson <public@khwilliamson.com>
Wed, 22 Jan 2014 18:45:59 +0000 (11:45 -0700)
commit119ee68b322bc73b342f2052597ac5187f18d365
tree4feffcb3f10af8b075085c7c3f3ae97606ccd5e1
parentd646bffec1670f95f61ba05ca3da10a8deb21664
locale.c: Find utf8-8 locales reliably on C99 platforms

locale.c has a function that tries to determine if the current POSIX
locale is a UTF-8 locale.  Prior to this patch, it used nl_langinfo() to
determine this, falling back to heuristics if that is unavailable on the
platform.  nl_langinfo()  is part of POSIX.1-2001.  -This patch adds the
use of two functions from C99, mbtowc() and MB_CUR_MAX,  that also give
reliable results.
locale.c