Created
November 2, 2016 18:06
-
-
Save jweinst1/ebb00e8cfa8cecae7f3cb1bccf2f1ed9 to your computer and use it in GitHub Desktop.
convert uint8 to string in swift
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
let a:[UInt8] = [24, 27, 36, 50] | |
let str = String(bytes:a, encoding: String.Encoding.utf8) | |
//"$2" |
i got error when trying to convert this
let decripted = [229, 174, 41, 168, 208, 220, 160, 162, 124, 12, 150, 171, 229, 23, 75, 250, 230, 113, 228, 135, 231, 244, 232, 207, 254, 245, 16, 107, 65, 194, 47, 144, 246, 139, 154, 201, 171, 20, 104, 58, 63, 127, 8, 192, 87, 161, 209, 124]
let sstr = String(bytes:decripted, encoding: .utf8)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"\u{18}\u{1B}$2", not same Answer?