I've sort of moved away from recommending the automatic string conversion typemap that is available to both Inline::C and Inline::CPP, because it turns 100% of the responsibility for understanding everything there is to know about Unicode over to the C/CPP/XS programmer. I could be wrong in this notion, but to me the lure of simplicity in passing a Perl string to a c-string is deceptive and while presenting a slight savings in code up front, will create a need for a lot more hand-rolled code to support Unicode.
In my opinion (and I'd be happy to discover I'm wrong about this), it's easier to pass the string-containing SV, *as an SV*, and then use Perl's own string-handling "guts and API calls" to manipulate it. I realize that this somewhat defeats the "performance improvement" purpose of dropping into XS, but strings are truly one of those areas where Perl's native performance is as it is because it's doing so much (most of which has become necessary in a Unicode world). -- David Oswald daosw...@gmail.com