Thank you for suggestion. I tried that first, but my cocoa application keeps crashing.
If I make a little C program to do the "conversion" it works as expected. However, when I try to integrate it into my obj-c program, crashes occur.
I've tried converting to/from c-style cstrings with things like stringWithCString, but still no joy.