Replaced deprecated stringWithCString: with stringWithCString:encoding: