Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix null characters in binary plists#329

Open
dnicolson wants to merge 1 commit intosbarex:mastersbarex/SourceCodeSyntaxHighlight:masterfrom
dnicolson:patch-3dnicolson/SourceCodeSyntaxHighlight:patch-3Copy head branch name to clipboard
Open

Fix null characters in binary plists#329
dnicolson wants to merge 1 commit intosbarex:mastersbarex/SourceCodeSyntaxHighlight:masterfrom
dnicolson:patch-3dnicolson/SourceCodeSyntaxHighlight:patch-3Copy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.