Comments (1)
Hi there! Sorry for the delay.
Unfortunately, the data inside each key -- ANSIBlackColor
, ANSIBlueColor
, etc. is an embedded data stream. You will need to use []byte
instead of string
to access it.
Unfortunately, your problems won't end there. The person who authored these property lists actually embedded smaller, individual property lists inside each value!
There's a tool in this repository that can help you understand the topology of a property list, and also decode property lists that are embedded inside other property lists.
That tool is called ply.
As an example, this is what it thinks about one of those terminal color schemes.
(I've removed some of the data for brevity!)
$ ply .\Chalkboard.terminal
{
columnCount: 90
name: Chalkboard
rowCount: 50
type: Window Settings
ANSIBlackColor: 00000000 62 70 6c 69 73 74 30 30 d4 01 02 03 04 05 06 15 |bplist00........|
... data removed ...
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b6 |................|
... more data removed ...
}
Looking at that, you can see that it contains name
and type
and they're just strings, but that it also contains ANSIBlackColor
. It's a bit hard to tell from here, but it uses a hex dump display format to show that it's just a []byte
.
Looking at the contents of ANSIBlackColor
further, you can see it starts with bplist00
. That's a binary property list!
ply can help you look inside it, with the !
operator.
$ ply .\Chalkboard.terminal -k "ANSIBlackColor!"
{
$archiver: NSKeyedArchiver
$objects: (
[0]: $null
[1]: {
$class: #2
NSColorSpace: 2
NSRGB: 00000000 30 20 30 20 30 00 |0 0 0...........|
}
[2]: {
$classes: (
[0]: NSColor
[1]: NSObject
)
$classname: NSColor
}
)
$top: {
root: #1
}
$version: 100000
}
It turns out that it's an archived instance of NSColor. That's getting pretty deep into the weeds.
Unfortunately, these files aren't very good for the go-plist
library. They work, and you can parse them, but they are serialized versions of objects from Apple's Objective-C frameworks. The internal layout of each one may be different, and I haven't yet written a library to "unarchive" them further than you can see above. :(
Hope that helps!
from go-plist.
Related Issues (20)
- Missing support for GNUstep <[ base64data ]> HOT 1
- Marshalling happens in reverse order. HOT 3
- Turn UID into CF$UID for (GNUstep) text format too
- OpenStepFormat parsing can't handle escaped quotations HOT 2
- Byte summary case isn't handled HOT 4
- gitlab.howett.net down? HOT 6
- Error: reflect: call of reflect.Value.Type on zero Value HOT 1
- marshal byte array failed HOT 2
- how to define nested structure HOT 2
- Don't panic, use error returns!
- Encoding of aposthropes for OpenStep formatted plists HOT 1
- Module naming in go.mod uses the module "howett.net/plist" instead of "github.com/DHowett/go-plist" HOT 1
- Can't decode plist file that contains <array> HOT 3
- strong typing of dictionaries HOT 4
- How to handle plists with keys with commas? HOT 1
- Question: flatten property
- Embedded structs' fields are not omitted HOT 2
- Error parsing some seemingly valid binary plists (illegal integer size) HOT 1
- plist.Marshal("aaa", plist.BinaryFormat) is not return the expected value HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-plist.