#322 ✓resolved
Eric Monti

libplist utf-8 conversion bugginess

Reported by Eric Monti | March 19th, 2013 @ 09:18 PM | in 1.2.0 Release

Environment:
Testing on osx snow leopard using libplist-1.10, also tested on libplist-0.8

Problem:

Certain 'apparently legal' utf-8 sequences are not properly converted by libplist. These sequences convert correctly using apple's plutil -convert xml1, but not using plistutil (or the c library directly -- tested via python and ruby bindings)

The resulting plist conversion does not work when parsing by other apple tools.

To reproduce:

See the attached files. sample.bin.plist (original binary src plist) and sample.xml.plist (converted using apple's plutil).

Here's a plist dump of the sample

{
    ProblematicValue = "\Ud83c\Udf1fCute utf-8 art\Ud83c\Udf1f";
}

Try converting sample.bin.plist to xml with plistutil and examining the output with apples plutil:

$ ./plistutil-1.10 -i sample.bin.plist -o sample.lpl.plist
$ plutil -p sample.bin.plist 
{
  "ProblematicValue" => "🌟Cute utf-8 art🌟"
}
$ plutil -p sample.xml.plist 
{
  "ProblematicValue" => "🌟Cute utf-8 art🌟"
}
binbag:plistutil monti$ plutil -p sample.lpl.plist 
sample.lpl.plist: Unable to convert string to correct encoding

$ diff sample.xml.plist sample.lpl.plist 
6c6
<    <string>🌟Cute utf-8 art🌟</string>
---
>    <string>??????Cute utf-8 art??????</string>

Note, you can't see it in this forum, but the string "Cute utf-8 art" is enclosed on either side by a utf-8 star icon. using the sequence: "\Ud83c\Udf1f"

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket

Attachments

Pages