Skip to content

Conversation

@dnicolson
Copy link
Contributor

This prevents null characters from terminating lines when converting binary plist files to XML.

Before:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>nullByte</key>
    <string>text
</dict>
</plist>

After:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>nullByte</key>
    <string>text␀more</string>
</dict>
</plist>

@sbarex
Copy link
Owner

sbarex commented Dec 9, 2025

But is it a normal/frequent condition for there to be null characters?

Can you attach me a plist with that problem?

@dnicolson
Copy link
Contributor Author

Not frequently, but I have encountered control characters in binary plist files, presumably when unfiltered text is stored in string fields. In that instance, it broke some text editors (now fixed) when trying to decode the binary into XML.

null-byte.plist.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants