MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format
Apache License 2.0
1.75k stars 125 forks source link

Encode log data to ascii string using c string pointer #217

Open memoto opened 3 weeks ago

memoto commented 3 weeks ago

Swift 6 String's init?(data: Data, encoding: String.Encoding) fails validation during encoding utf8 data to ascii and returns nil.

As proposed solution we inspect memory buffer bound to UInt8/CChar bytes, assuming they are null-terminted which allows us to produce a new string by simply copying them and interpreting as ascii.