Skip to content

Instantly share code, notes, and snippets.

@sho-ito-1027
Last active February 19, 2018 17:14
Show Gist options
  • Save sho-ito-1027/98464a9f0b0b0003b9c8f34adae6faab to your computer and use it in GitHub Desktop.
Save sho-ito-1027/98464a9f0b0b0003b9c8f34adae6faab to your computer and use it in GitHub Desktop.
error: unprintable ASCII character found in source file
// playground
var total: String = ""
for i: UInt8 in 0...255 {
let data1: [UInt8] = [i]
let value = Data.init(bytes: data1)
let char = String.init(data: value, encoding: .utf8)
if let char = char {
total += char
}
}
print(total)
// copy & paste total characters
// error: unprintable ASCII character found in source file
// why?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment