[ python-Feature Requests-843590 ] 'macintosh' encoding alias for 'mac_roman'

SourceForge.net noreply at sourceforge.net
Sun Dec 19 21:09:40 CET 2004


Feature Requests item #843590, was opened at 2003-11-17 10:29
Message generated for change (Comment added) made by yenzenz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=843590&group_id=5470

Category: Unicode
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stuart Bishop (zenzen)
Assigned to: Nobody/Anonymous (nobody)
Summary: 'macintosh' encoding alias for 'mac_roman'

Initial Comment:
OS X's Mail.app can generate Subject lines like:
Subject: =?MACINTOSH?B?vLu7vMGqo6KwpKalu7w=?=

(Which decodes to 
'\xbc\xbb\xbb\xbc\xc1\xaa\xa3\xa2\xb0\xa4\xa6\xa5\xbb\xb
c')

This appears to be what Python calls the mac_roman
encoding. I suggest adding 'macintosh' as an alias to
'mac_roman' to encodings/aliases.py to allow the email
package to decode these headers.


----------------------------------------------------------------------

Comment By: Jens Klein (yenzenz)
Date: 2004-12-19 21:09

Message:
Logged In: YES 
user_id=474612

seems its a bit more difficult:
encoding 'macintosh is registered by iana[1] (nice formatted in [2]) and is 
covered by RFC1345[3].

Name: macintosh [RFC1345,KXS2]
MIBenum: 2027
Source: The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991
Alias: mac
Alias: csMacintosh

[1]http://www.iana.org/assignments/character-sets
[2]http://www.cs.tut.fi/~jkorpela/chars/sorted.html
[3]http://www.faqs.org/rfcs/rfc1345.html

so far the hard facts from specification view. in all these specs are 
mac_roman etc. not mentioned. So what?

I found at [4] with the popular program 'recode' a hint of the alias. the aothor 
there uses the iana registered macintosh as an alias for mac_roman:

DEFENCODING(( "MacRoman",               /* JDK 1.1 */
              /* This is the best table for MACINTOSH. The ones */
              /* in glibc and FreeBSD-iconv are bad quality. */
              "MACINTOSH",              /* IANA */
              "MAC",                    /* IANA */
              "csMacintosh",            /* IANA */
            ),
            mac_roman,
            { mac_roman_mbtowc },         { mac_roman_wctomb, NULL })

[4]http://recode.progiciels-bpi.ca/showfile.html?name=fusion/recode-3.6/
libiconv/encodings.def

Because of that (I trust recode somehow) i would propose to add macintosh 
as an alias for mac_roman.


----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2004-12-19 00:01

Message:
Logged In: YES 
user_id=38388

I have no problem adding aliases to the encodings package,
but please provide some reference that this actually is a
valid alias for the mac_roman encoding. There are quite a
few other mac_* encodings to choose from as well, so the
coice is not obvious to me.

----------------------------------------------------------------------

Comment By: Jens Klein (yenzenz)
Date: 2004-12-18 23:49

Message:
Logged In: YES 
user_id=474612

+1 from me

Archetypes (a Zope framework) runs also in a problem because of the 
missing alias.

more infos:
https://sourceforge.net/tracker/index.php?
func=detail&aid=1068001&group_id=75272&atid=543430


----------------------------------------------------------------------

Comment By: Stuart Bishop (zenzen)
Date: 2003-11-17 11:47

Message:
Logged In: YES 
user_id=46639

The test was just a sequence of random high-bit characters:

ºªªº¡™£¢?§¶•ªº

(lets see if the web interface lets that through).

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2003-11-17 11:12

Message:
Logged In: YES 
user_id=38388

Are you sure ? The decoded string you give does not look
like anything readable...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=843590&group_id=5470


More information about the Python-bugs-list mailing list