         case .iOS:
             fileName = "Localizable.strings"
         }
-        let currentFilePath = currentDirPath.URLByAppendingPathComponent(fileName)
-        result.dataUsingEncoding(NSUTF8StringEncoding)?.writeToURL(currentFilePath, atomically: true)
-        
+        let currentFilePath = currentDirPath.appendingPathComponent(fileName)
+        try! result.data(using: String.Encoding.utf8)?.write(to: currentFilePath, options: [])
+
         print(currentFilePath)
     }
 }

        } else if line[i] != "" && (forPlatform.contains(platform)) {
            let localization: String
            if platform == .Android && key.hasPrefix("google_play_") {
                let fileName = key.stringByReplacingOccurrencesOfString("google_play_", withString: "")
                let langCode = firstRow[langIndex]
                let regionCode: String?
                switch langCode {
                    case "en": regionCode = "GB"
                    case "nl": regionCode = "NL"
                    case "de": regionCode = "DE"
                    case "fr": regionCode = "FR"
                    default: regionCode = nil
                }
                
                if let rc = regionCode {
                    let dirPath = path.URLByDeletingLastPathComponent?
                        .URLByAppendingPathComponent("fastlane")
                        .URLByAppendingPathComponent("metadata")
                        .URLByAppendingPathComponent("android")
                        .URLByAppendingPathComponent(langCode + "-" + rc)
                    try! NSFileManager.defaultManager().createDirectoryAtURL(dirPath!, withIntermediateDirectories: true, attributes: nil)
                    let currentFilePath = dirPath!.URLByAppendingPathComponent(fileName + ".txt")
                    let value = line[i].stringByReplacingOccurrencesOfString("\\n", withString: "\n")
                    value.dataUsingEncoding(NSUTF8StringEncoding)?.writeToURL(currentFilePath, atomically: true)
                    print(currentFilePath)
                }
            } else {

    return platform
}

dump(CommandLine.arguments)
let platformP = CommandLine.arguments[1]
let platform = parseOutputPlatformName(input: platformP) ?? .iOS
let fileP = CommandLine.arguments[2]
let path = NSURL(fileURLWithPath: fileP)
let data = NSData(contentsOf: path as URL)
let strings = String(data: data! as Data, encoding: String.Encoding.utf8)
let lines = strings!.components(separatedBy: "\n")
var splitted = lines.map { (string: String) -> [String] in
    return string.trimmingCharacters(in: CharacterSet.newlines).components(separatedBy: "\t")
}

var langs = [[String]]()
var firstRow = splitted.removeFirst()
firstRow.removeFirst() // "PLATFORM"
firstRow.removeFirst() // "KEY"
for _ in firstRow {
    var translations = [String]()
    if platform == .Android {
        translations.append("<!--")
