More constructive response follows, interleaved.
--On Monday, March 17, 2003 8:50 PM -0800 Jon Reinsch <[EMAIL PROTECTED]> wrote:
I use a simple MacPerl program to archive my email: I save each message to a text file, then run the program to append the messages to a text file in date/time order. Omitting some details, the heart of the program is just:
open (inhandle,"$infilename")) { while(<inhandle>) { print $outhandle $_; } }
Basically works like 'cat'. Or 'Catenate', if you use MPW.
My problem is that some of my email contains Japanese text. I'm running OS 9.2.1 with the Japanese Language Kit installed. But when Japanese text goes through the program it comes out as garbage like "bÉvÇ?ñ?éwÇ?Ç?Ç»Ç?ÇÃÉiÉrÉQÅ[É^Å". Obviously the encoding is being lost, but I don't have the slightest idea how to fix this. Is there a module out there that would provide a simple answer to this problem? Maybe it's just a fantasy, but I'm hoping for something simple like print $outhandle convertJapaneseText($_);
Convert it to what? I suspect that the problem appears intractable because in fact, it doesn't really exist. Your script does a byte-for-byte copy, so nothing is getting lost.
The real problem (as far as I can tell) is that the Japanese text is not being
*displayed* properly. They're multi-byte data -- no conversion will adapt them to single-byte display. You'd have the same problem with HTML or base64-encoded content -- you'll see the raw message, not the rendered/decoded content.
I don't know what app you're using to ultimately view the messages (MacPerl?), but that's where your problem (as well as its solution) lies.
Let me know if this helps, or if I'm completely off-base. :-)
Josh