环境参照
ITEM | VARIABLES |
---|---|
OS | macOS Big Sur version 11.6 |
Memory | 16 GB |
CPU | Intel Core i7 2.5 GHz |
Java | oracle “11.0.9” 2020-10-20 LTS |
PostgreSQL | 14.0 |
不安装 Xcode 使用 Command Line Tools
- 使用命令:
xcode-select --install
安装 CLT。或者 https://developer.apple.com/download/all/ 从 APPLE 下载安装包,进行安装。 - 一些常用命令:
命令 | 说明 |
---|---|
xcode-select -p | 查看 CLT 的安装位置 |
xcode-select -v | 查看 CLT 的版本 |
softwareupdate --list | 查看可升级列表 |
softwareupdate --install -a | 升级所有包 |
softwareupdate --install |
升级指定的包 |
~/.CFUserTextEncoding 文件
~/.CFUserTextEncoding
stores the default text encoding and preferred language for a user. Below is an excerpt from Technical Note 2228 of the Mac OS X Reference Library with some more information:
Core Foundation tries to access the user’s home directory to determine their default text encoding (stored in the file ~/.CFUserTextEncoding). If you switch the EUID to the UID of the logging in user and then call CF, you may have problems when Core Foundation accesses this file. You can prevent this access by setting an environment variable that tells Core Foundation the default text encoding to use. The environment variable name is __CF_USER_TEXT_ENCODING. Its value should be constructed with the format string “0x%X:0:0”, where %X is replaced by the UID of the logging in user.
By default, my copy of ~/.CFUserTextEncoding
contained 0:0. The first number to the left of the colon represents the default encoding. The 0 in my file is for kCFStringEncodingMacRoman. A list of encodings and the associated number can be found in the CFString Reference
The value after the colon represents the user’s preferred language. To change the preferred language go to Language & Text under System Preferences and move a new language the top of the list. To confirm what the file changed to, you can open Terminal and type cat ~/.CFUserTextEncoding
, which yielded 0:3 when I changed my preferred language from English to Deutsch.