Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Night Birds

Suspended
Original poster
Nov 29, 2018
6
0
Hi,

*I previously had Atom editor installed and used it to open a few .plist files and web files. Believing that was the culprit of the below, I've removed the program.*

I'm not sure what I did, possibly edited something or changed a setting that I don't recall, but anytime I open .plist files in textedit, they open in TextEdit as garble, or maybe with incorrect decoding or something.

However, when I open them in QuickLook, they appear perfectly in fine display and formatting. I believe that is the proper XML formatting, what I'm used to seeing in TextEdit??

See attached photos.View attachment 807438 View attachment 807439

BTW, the files do not seem to be corrupted, as everything is working fine.

Please help!
 
The 2nd one is what's called a "binary plist". You can tell because it starts with "bplist", which is a magic number that stands for "binary plist".

You can learn about this format by googling "binary plist spec". Example search results:
https://medium.com/@karaiskc/understanding-apples-binary-property-list-format-281e6da00dbd
https://opensource.apple.com/source/CF/CF-550/CFBinaryPList.c

The 1st one is the XML representation of the binary plist. That is, if you converted the bplist format to XML, that's what you'd see.

The command-line tool that converts between plist formats is called 'plutil'. You can google it to read what it does, its options, args, etc.


FWIW, some programs will recognize bplist format and automatically present the XML representation. Programming editors typically do this, e.g. Xcode's editor, BBEdit, etc. TextEdit is not a programming editor, so it apparently lacks this feature.
EDIT: Or maybe TextEdit had this feature and it was removed. The versions I tested don't show a bplist file as XML.
 
Last edited:
  • Like
Reactions: Night Birds
Thanks man, I appreciate the answer and all the details.

It's so weird though, I swear I've opened and edited .plist files in TextEdit and seen them as XML. Idk, maybe I'm mistaken, maybe they were some other sort of OS files...

I just downloaded Sublime tonight, and read that there's a plugin to auto convert binary plists to XML. So, that shall work, although I am still curious if I accidentally flipped off some functionality somewhere. Or maybe I'm high. I don't know.

Thanks!
 
Thanks man, I appreciate the answer and all the details.

It's so weird though, I swear I've opened and edited .plist files in TextEdit and seen them as XML. Idk, maybe I'm mistaken, maybe they were some other sort of OS files...

I just downloaded Sublime tonight, and read that there's a plugin to auto convert binary plists to XML. So, that shall work, although I am still curious if I accidentally flipped off some functionality somewhere. Or maybe I'm high. I don't know.

Thanks!
Depending on the plist, it's possible that it used to be in XML format and it got converted. Any number of things might trigger that, such as a system update, a revision to the program using the plist, and so on. There's also a possibility that the system default is now bplist, so that if any value is changed, such as in a preferences file, the result is written in bplist form even if it was loaded from XML form. I'm not certain of what can trigger a conversion, but it's definitely happened to me before.

I've also definitely edited plist files in TextEdit. I do it often, to be honest. However, they're usually ones that I've made myself, such as for a LaunchAgent. And I was just fiddling around with a couple of them within the last week, so I know they started in XML and stayed that way.
 
Yeah, thanks. All of them that I was looking at, were in users/user/library/preferences, so it's possible all of those are stored as plist binaries, while others elsewhere are not (and those are the ones that I was looking at previously in TextEdit).

I'll try out the plist plugin for Sublime, that should work fine; I hardly ever need to open them tbh.

Thank you again, happy holidays.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.