Я просто хочу преобразовать fileURLWithPath в шестнадцатеричный формат utf8, как показано ниже. Swift.
import Cocoa
// this swift file name is aaa.swift
let arguments = CommandLine.arguments
let str = "\(arguments)"
let url = URL(fileURLWithPath: str)
print(url)
, и я посылаю переменную пути bash в файл aaa.swift.как показано ниже path = "/ Volumes / aaa / ccc.mov"
swift aaa.swift $path
, затем распечатайте на терминале, как показано ниже:
%5B%22./aaa.swift%22,%20%22/Volumes/aaa/ccc.mov%22%5D -- file:///Volumes/aaa/
Я хочу получить "/ Volumes / aaa / ccc.mov "эта часть .. как это сделать ??