Okay, in Mathematica, if you want to save a string to a file, you could use Export:
stringToExport = "this is a test string";
Export[<filepath>, stringToExport]
When you said that Mathematica "would make everything very easy", I assumed that meant that you already knew how to do it in Mathematica.
If you did already know how to use Export, then I don't know what your question is now. Earlier you said that you were indeed asking for FFI, and Rohit gave you links to relevant resources, but now you seem to be saying that those weren't helpful.
You mentioned encodings, maybe that's your real question. Maybe this will be helpful: http://reference.wolfram.com/language/ref/CharacterEncoding.html
I'm also confused about why, if everything is easier in Mathematica, you aren't just doing this string processing in Mathematica in the first place.
Anyway, I'm sorry, but I just have no idea what you're trying to accomplish nor what the specific hurdles are that you're encountering.