You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
it seems that there is a bug in the toBinary() function.
my sample php-code does this:
$plist = new CFPropertyList();
$plist->add($tmpDict = new CFDictionary());
$tmpDict->add('name', new CFString("Täst"));
echo $plist->toBinary();
Attention on the german ue-character in "Test" <-----
The output is not readable by NSPropertyListSerialization.
i saw that the last byte in the data is the value 0x16 but it should be 0x19 (compared with binary generated by Apple's Property List Editor!
I had a look into the toBinary()-function in CFBinaryPropertyList.php and found the following:
the function uniqueAndCountValues() counts the $stringSize from the original string value and not the utf16-value. so at the end the $table_offset is incorrect. I am right?
protected $stringSize = 0; // The length of all strings in the file (byte length, not character length)
I cannot reproduce your problem. I executed your code (saved as UTF-8, of course) and created the same plist with Property List Editor. Both files are identical (verified via md5 checksum).
Is it possible one of your (script) files is not UTF-8? Or your data isn't?
Hi there,
it seems that there is a bug in the toBinary() function.
my sample php-code does this:
Attention on the german ue-character in "Test" <-----
The output is not readable by NSPropertyListSerialization.
i saw that the last byte in the data is the value 0x16 but it should be 0x19 (compared with binary generated by Apple's Property List Editor!
I had a look into the toBinary()-function in CFBinaryPropertyList.php and found the following:
the function uniqueAndCountValues() counts the $stringSize from the original string value and not the utf16-value. so at the end the $table_offset is incorrect. I am right?
protected $stringSize = 0; // The length of all strings in the file (byte length, not character length)
best regards
Gabriel Gritsch
gabriel@gritsch-soft.com
The text was updated successfully, but these errors were encountered: