Created
July 27, 2020 11:12
-
-
Save fdstevex/5412fad1d205e8b00ad6288e0769389b to your computer and use it in GitHub Desktop.
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
#!/bin/swift | |
// Print all the characters in the "Supplementary Private Use Area-B" block. | |
import Cocoa | |
for ch:UInt32 in 0x100000..<0x10FFFF { | |
let arr = [ch] | |
let array: [UInt32] = [CFSwapInt32(ch)] | |
let data = array.withUnsafeBytes { (ptr) -> Data in | |
return Data(ptr) | |
} | |
if let str = String(data: data, encoding: .utf32) { | |
print("\(String(format: "%08X", ch)): \(str)") | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment