[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Modules] XML::Parser: support for native Mac (Roman) character set?



I happen to mention this stuff in a recent PerlMonth column 
(ScriptDifferent, column under www.perlmonth.com, I think Issue 10). The 
long and short of it 
is, using MacPerl you can do everything you need to do with Unicode::String 
and Unicode::Map8.

I look at both directions in the article. You have solved the problem of 
getting MacRoman scripts into UTF-8, but at some point you may want to 
recover UTF-8 output back into MacRoman. Under some very specfic conditions 
you can, of course, use original_string().

It's also worth reading a recent article in XML.COM, www.xml.com, entitled 
"Character Encodings in XML and Perl", by Michel Rodriguez.

Arved Sandstrom

P.S. Encodings are neat. If you come up with any new observations on XML and 
MacPerl and encodings, please share 'em with the group. Thanks.

At 12:37 PM 4/29/00 -0700, Mat Marcus wrote:
>At 6:44 AM -0400 4/29/00, Chris Nandor wrote:
>>At 11.04 -0700 2000.04.28, Mat Marcus wrote:
>>>I am trying to parse XML files output by CodeWarrior on the Mac.
>>>Typically these files contain some native mac roman characters -- µ
>>>(mu) for example. I was searching the archives of this list and
>>>noticed that Bart Lateur posted some relevant scripts some time back.
>>>Unfortunately these don't appear to be accessible via the archive.
>>>What was the final outcome? Is there a file I can drop into my
>>>site_perl somewhere to make XML::Parser happy? Could someone forward
>>>me the scripts so that I can try it myself?
>>
>>I am not sure what the problem is, why XML::Parser is unhappy.  Is it
>>because it is barfing on the non-ASCII characters?  In XML::Parser's docs,
>>it says you can do something like this:
>>
>>   $xml->parsefile($file, ProtocolEncoding => 'ISO-8859-1');
>>
>>However, you probably want MacRoman, and I don't think it comes with
>>MacRoman.  You can try to build your own; see the ENCODINGS section of the
>>XML::Parser docs.
>>
>>--
>>Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
>>Andover.Net        | chris.nandor@andover.net | http://slashcode.com/
>
>
>Chris,
>
>Thanks. I read over the thread from the archives again. I see that 
>the scripts referred to were part of the XML::encoding package. I 
>patched the scripts as recommended. Then I went ahead and created the 
>macroman.enc file and dropped it into my XML::Parser encodings folder 
>and now XML::Parser is happy. Do you think macroman.enc should be 
>added to the XML::Parser mac port or even to XML::Parser?
>
>Mat
>
>==== Want to unsubscribe from this list?
>==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org
>
>


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org