[
https://issues.apache.org/jira/browse/STDCXX-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475626#comment-13475626
]
Liviu Nicoara commented on STDCXX-1073:
---------------------------------------
The following still fails with the first patch:
{noformat}
$ cat ../../tests/localization/t.cpp; nice make t.cpp && ./t af_ZA.utf8; echo $?
#include <iostream>
#include <locale>
#include <string>
int
main (int argc, char** argv)
{
std::locale loc (argv [1]);
const std::collate< char >& fac =
std::use_facet< std::collate< char > > (loc);
char const buf [] = "a\0\0b";
std::string s = fac.transform (buf, buf + sizeof buf - 1);
size_t i = 0;
for (; i < s.size () && 0 == s [i]; ++i) ;
return !(i == 2);
}
1
{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
>
> Attachments: collate.cpp.patch
>
> 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