I have a string encoded as ascii characters that contains letters and numbers. When I print out the string it looks like the numbers are not showing up properly. The string is being read from a data object where I convert everything to an Int8 type and construct a Character from that:
for i in 0..<dataLength {
let byte: Int8 = readByte()
let char = Character(unicodeScalarLiteral: .init(.init(byte)))
print("Character: ", char, char.asciiValue)
}
Example.) "40" appears as "@D". I was able to print out the ascii codes of these and found it to be [64, 68], but I'm not sure how to now convert it to the number 40.