stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liviu Nicoara (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STDCXX-1073) Narrow collate_byname transform with libc removes embedded NULs
Date Wed, 10 Oct 2012 12:05:02 GMT

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

Liviu Nicoara commented on STDCXX-1073:
---------------------------------------

Test case:

{noformat}
$ cat t.cpp; nice make t && ./t af_ZA.utf8 || echo failed
#include <iostream>
#include <locale>
#include <string>

int
main (int argc, char** argv)
{
    char const c [] = "a\0c";

    std::locale loc (argv [1]);

    const std::collate<char>& col =
        std::use_facet<std::collate<char> > (loc);

    std::string s = col.transform (c, c + sizeof c / sizeof *c - 1);

    for (size_t i = 0; i < s.size (); ++i) {
        if (0 == s [i])
            return 0;
    }

    return 1;
}
make: `t' is up to date.
failed
{noformat}
                
> Narrow collate_byname transform with libc removes embedded NULs
> ---------------------------------------------------------------
>
>                 Key: STDCXX-1073
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1073
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization
>    Affects Versions: 4.2.1, 4.2.x
>         Environment: Independent.
>            Reporter: Liviu Nicoara
>            Assignee: Liviu Nicoara
>            Priority: Minor
>              Labels: NUL, collate_byname, strxfrm
>             Fix For: 4.2.x, 4.3.x, 5.0.0
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Transform should preserve embedded NULs. The narrow specialization of collate_byname,
when using libc strxfrm, removes the embedded NULs. Comparisons of transformed strings is
altered.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message