I’m looking for a character encoding that allows me to set a byte higher than 127. NSASCIICharacterEncoding and NSUTF8CharacterEncoding replace those higher values.
I’m looking for a character encoding that allows me to set a byte higher
Share
The character encoding only matters when you’re trying to interpret the bytes as characters. If that’s what you need to do, and if you’re using data that comes from some outside source, then use whatever encoding the outside source used.
On the other hand, if you’re just trying to manage a collection of bytes (i.e. not characters), then look into using NSData instead. NSData doesn’t care about character encodings, doesn’t change the order of your bytes, and will happily keep track of as much data as you give it. (There’s a mutable version if you need to modify the data it contains.)