So I have this .CFUserTextEncoding file in my home dir. Google search results are less than ideal, filled with old ugly forum pages. Apple gives me an unrelated support article. ADC gives me an unrelated technote.

All I can gather thus far is that it's related to Core Foundation, and, well, some user text encoding. Anyway:

  • Why do I have it?
  • Can I not have it?
  • What's it for, what does it affect?
  • What format is it in?
  • Should I edit it manually?
  • Could I, regardlessly?
  • or should this be on stackoverflow because of core foundation?
    – kch
    Dec 11, 2009 at 22:47
  • You might have better luck at SO, since it's related to CoreFoundation. Dec 12, 2009 at 0:10

2 Answers 2


~/.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.

  • So. Does it sound like a good idea to change the encoding value to that of kCFStringEncodingUTF8?
    – kch
    Dec 12, 2009 at 4:15
  • 4
    Yay, cool. I changed the file to 0x08000100:0, and now triggering the Finder's Quick Look on UTF-8 text/plain files displays extended characters properly.
    – kch
    Dec 12, 2009 at 4:19
  • 3
    echo "0x08000100:0" > ~/.CFUserTextEncoding does the trick, but this is known to cause problems when saving files in Adobe Illustrator CS5. Sep 26, 2011 at 6:33
  • Use echo -n "0x08000100:0x0" > ~/.CFUserTextEncoding to avoid adding an unintentional newliine.
    – MERM
    Jan 26, 2016 at 17:04
  • Note that opening your Language & Region preferences panel may reset the file to the default encoding. Feb 5, 2019 at 18:03

The file is simply two numbers separated by a colon; the second of which corresponds to the active language. Answering your questions:

Why do I have it? What's it for, what does it affect? Applications use it for pull in the environment when starting.

Can I not have it? It'll most likely be recreated.

What format is it in? Arbitrary.

Should I edit it manually? If you're ready for your Mac to be in a random language!

Could I, regardlessly? Of course.

  • Why do you state that the format is arbitrary? The format of a number, colon, number (e.g., 0:0) in the file corresponds to the user's default text encoding and the user's preferred language. Doesn't seem arbitrary to me. Dec 12, 2009 at 3:19
  • 1
    A comma would suffice, as would a space, an apostrophe, etc. The numbers could have been the other way around. They were arbitrarily chosen.
    – Jeremy L
    Dec 12, 2009 at 16:37
  • 1
    Format != content.
    – Jeremy L
    Dec 12, 2009 at 16:38
  • 1
    Changing this file will have no impact on what language your Mac runs in. That's stored in the AppleLanguages array in your user's global domain preferences.
    – lensovet
    Aug 30, 2014 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.