Last active
February 19, 2018 17:14
-
-
Save sho-ito-1027/98464a9f0b0b0003b9c8f34adae6faab to your computer and use it in GitHub Desktop.
error: unprintable ASCII character found in source file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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