[RFC] libstdc++/9817 or "passing C++ strings to C functions"
Paolo Carlini
pcarlini@unitus.it
Sun Feb 23 13:56:00 GMT 2003
Hi,
this bug is in fact about a general issue: when using underlying
C functions for strings, any C++ string with '\0' in the middle
cannot be processed as is, in that only the first hunk ends up being
considered: the length information is lost. This is the case, in
particular, of strcoll (which we'd like to exploit for collate::compare)
and strxfrm (for collate::transform).
Now, I have got an idea: what about substituting a conventional char
for the original '\0' (f.i., '$') and then calling strcoll (strxfrm,
respectively) as usual?
Other proposals?
Paolo.
More information about the Libstdc++
mailing list