stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-860) localedef: missing characters for an ellipsis in LC_CTYPE
Date Sat, 12 Apr 2008 22:30:04 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588332#action_12588332
] 

Martin Sebor commented on STDCXX-860:
-------------------------------------

That the characters are really missing (and that the {{locale}} utility isn't lying) can be
confirmed using the program below:
{noformat}
$ cat t.cpp && ./t ./ctype
#include <cstdio>
#include <locale>

int main (int argc, char *argv[])
{
    const std::locale loc (1 < argc ? argv [1] : "");
    const std::ctype<char> &ct = std::use_facet<std::ctype<char> > (loc);

    const std::ctype_base::mask masks[] = {
        ct.lower, ct.space, ct.print, ct.cntrl, ct.alpha,
        ct.digit, ct.punct, ct.graph, ct.xdigit
    };

    for (unsigned i = 0; i != sizeof masks / sizeof *masks; ++i) {
        std::printf ("%#x: ", masks [i]);
        for (unsigned j = 0; j != 256; ++j) {
            if (ct.is (masks [i], char (j)))
                std::printf ("\\x%02x ", j);
        }
        std::putchar ('\n');
    }
}
0x10: 
0x1: 
0x2: 
0x4: 
0x20: 
0x40: 
0x80: 
0x200: \x64 \x65 \x66 
0x100: 
{noformat}

> localedef: missing characters for an ellipsis in LC_CTYPE
> ---------------------------------------------------------
>
>                 Key: STDCXX-860
>                 URL: https://issues.apache.org/jira/browse/STDCXX-860
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 4.2.0
>            Reporter: Martin Sebor
>            Priority: Critical
>             Fix For: 4.2.2
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> The {{localedef}} utility appears to skip characters specified using the ellipsis in
the {{LC_CTYPE}} section. The output below was obtained on Solaris 10 (the "couldn't set locale
correctly" messages are written out by libc). The number of characters specified in the {{ctype.src}}
source file is 6 ('a', 'b', 'c', 'd', 'e', and 'f'). The output of the {{locale}} utility
shows that the generated locale contains only the last three characters ('d', 'e', and 'f').
> {noformat}
> $    cat ctype.src; rm -rf ctype; \
>      ./localedef -c -w -f ~/stdcxx/etc/nls/charmaps/ISO-8859-1 -i ctype.src ctype \
>   && LC_ALL=ctype ./locale -ck -h -w -l LC_CTYPE
> LC_CTYPE
> graph a..c;d;e;f
> END LC_CTYPE
> couldn't set locale correctly
> couldn't set locale correctly
> LC_CTYPE
> # ctype data:
> #   codeset: "ISO-8859-1"
> #   charmap: "ISO-8859-1"
> #   codeset_off: 24
> #   charmap_off: 35
> #   wmask_s: 3
> #   wtoupper_off: 0
> #   wtolower_off: 0
> #   wmask_off: 0
> #   ctype_ext_off: 0
> #   mb_cur_max: 1
> upper couldn't set locale correctly
> lower 
> space 
> print 
> cntrl 
> alpha 
> digit 
> punct 
> graph d;e;f
> xdigit 
> toupper 
> tolower 
> # ctype stats:
> #   total characters: 3
> #   upper characters: 0
> #   lower characters: 0
> #   space characters: 0
> #   print characters: 0
> #   cntrl characters: 0
> #   alpha characters: 0
> #   digit characters: 0
> #   punct characters: 0
> #   graph characters: 3
> #   xdigit characters: 0
> #   unclassified: 0
> #   tolower pairs: 0
> #   toupper pairs: 0
> END LC_CTYPE
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message