though I am not sure how it applies to a file format such as
.MP4
That’s an interesting question. MPEG-4’s container format is a ‘child’ of QuickTime, and QuickTime definitely used MacRoman for this. I’m not sure whether they removed that dependency as part of the standardisation process. It’s possible that they didn’t address it at all, and just standardised on the UInt32
values. The only way to know for sure is to look at the MPEG-4 standard itself.
Note about
String.data(using:)
:I had a hard time understanding where this is coming from.
Indeed. The Quick Help usually has a link to the documentation but that’s not present in this case. I suspect this is because the symbol is implemented in Foundation’s Swift overlay. Regardless, the fact that Xcode won’t take you to the documentation is bugworthy IMO. Please file a bug about that (and post your bug number, just for the record).
… it requires Foundation. Right?
Yes.
So this function requires bridging
String
toNSString
.
If I’m right, and this is part of Foundation’s Swift overlay, the bridging situation is nuanced.
Personally, I don’t lose a lot of sleep worrying about this sort of bridging. If something is slow and I’ve profiled it and the profile shows that bridging is part of the problem, I look into it. Otherwise I just accept it as a part of life.
Share and Enjoy
Quinn “The Eskimo!” @ DTS @ Apple