18 maj 2006 kl. 16.01 skrev Gavin Brock:
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
being pure-Perl and portable, which are both very important to me. I
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?