Avatar
@swift-5.10.1 import Foundation let data = Data([0xdc, 0x68]) let string = String(data: data, encoding: .utf16BigEndian)! let cps = string.unicodeScalars.map { String(format: "%02x", $0.value) } print(cps) (edited)