On May 18, 2006, at 8:29 AM, brian d foy wrote:
> * Will a plist always be utf8? For instance, what about
> localizations for Japan, etc? The encoding shows up in the <?xml ...?>
> portion, but am I going to have to open the file to find that, then
> re-open it?
I guess it is really up to the file - the first line (is it always
the first?) declares it:
<?xml version="1.0" encoding="UTF-8"?>
Maybe you could grab the first line, parse, and then slurp the rest
accordingly?
> * Actually hook into the Mac libraries and let the OS parse it and
> give me back the data. That's the best solution, but only if I give up
[quoted text clipped - 3 lines]
>
> * Can I hook into the Mac stuff with something like Inline::Java?
Actually, you can do this without resorting to Java - there was a
great article on using the Objective-C bridge (Foundation.pm) at:
http://www.macdevcenter.com/pub/a/mac/2005/07/29/plist.html
I had a quick hack based on this to create Mac::Tie::Plist:
http://search.cpan.org/~gbrock/Mac-Tie-PList-0.01/lib/Mac/Tie/PList.pm
Sadly it's read only for now - been meaning to look at it again.
.. Gavin
Manfred Bergmann - 18 May 2006 15:09 GMT
Am 18.05.2006 um 16:01 schrieb Gavin Brock:
>> * Actually hook into the Mac libraries and let the OS parse it and
>> give me back the data. That's the best solution, but only if I
[quoted text clipped - 9 lines]
>
> http://www.macdevcenter.com/pub/a/mac/2005/07/29/plist.html
You also can use Camelbones for reading and writing PropertyLists in
Perl.
I use it in my build processes and it works great.
Manfred
Brian D Foy - 18 May 2006 22:05 GMT
> Am 18.05.2006 um 16:01 schrieb Gavin Brock:
> > Actually, you can do this without resorting to Java - there was a
> > great article on using the Objective-C bridge (Foundation.pm) at:
> >
> > http://www.macdevcenter.com/pub/a/mac/2005/07/29/plist.html
> You also can use Camelbones for reading and writing PropertyLists in
> Perl.
> I use it in my build processes and it works great.
I saw that article too, and have been meaning to play with that stuff.
Christian Huldt - 18 May 2006 19:37 GMT
18 maj 2006 kl. 16.01 skrev Gavin Brock:
> On May 18, 2006, at 8:29 AM, brian d foy wrote:
>
[quoted text clipped - 18 lines]
>> will gladly add something to do that if someone writes it for me, but
>> alongside the pure Perl version.
Wouldn't it make sense to use some XML kit?
Or am I exposing my innocence by assuming those should take care of
the encoding?