A character encoding reflects the way the coded character set is mapped to bytes in memory. When using Terminal on macOS, you interact with the system via inputting characters, and the system needs to know how the characters are laid out in memory, which is the character encoding. Terminal by default uses UTF-8, which is described in the LANG environment, as you have noticed. In a Cocoa app, you handle text, which is a series of characters, via the Cocoa framework. Typically, you create a piece of text using String in Swift, or NSString in Objective C, and pass it to the system for text rendering. When creating a string type, you need to specify the encoding of your content – You can see that the init methods of Swift.String and NSString typically have an encoding parameter. If you don't, you are assumed to use the default encoding, which is UTF-8 for Swift.String and UTF-16 for NSString. Other than that, you most likely don't need to care the character encoding. Having said that, I am curious why yo
Topic:
App & System Services
SubTopic:
Core OS