Hello, In my application I read in a c-string, convert that c-string to an NSString, and then print that NSString using printf. If I input a newline character into the c-string, when I print the NSString, it prints out the '\n' character, instead of a newline. Here's the code (I don't really use scanf or a finite-length char like this in the real code!!):
char cInput[1000]; scanf( "%s", cInput ); NSString *input = [ NSString stringWithCString: cInput encoding: NSNonLossyASCIIStringEncoding ]; printf( "output: |%s|\n", [ input cStringUsingEncoding: NSNonLossyASCIIStringEncoding ] ); So when I run it, and enter in: Hi\n It prints out: output: |Hi\n| but I want it to print out: output: |Hi | I could always manually parse the output, and if a "\n" is found, then really print a newline, but that seems a bit too muddled. Any ideas? Thanks Nate _______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
