added encoding option with default value NSUTF8StringEncoding