ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pythonmac-sig
pythonmac-sig
[Pythonmac-SIG] ANN: TECManager 0.1 - Converts Mac encoded text to Unicode
by Bob Ippolito other posts by this author
Sep 6 2003 6:41AM messages near this date
Re: [Pythonmac-SIG] Creating an applet that includes wxPython | [Pythonmac-SIG] Need beta-testers for MacPython-Panther
While working on the latest revision of aeve, I realized that all of  
the AEText stuff is a pain in the ass.  I don't want to know that text  
is encoded in smRoman or smGreek, I just want text that works.  So, I  
did some research and figured out that The Way to make sense of  
script/language/region-ized text is to use part of Text Encoding  
Conversion Manager/UnicodeServices (  
http://developer.apple.com/documentation/Carbon/Reference/ 
Text_Encodin_sion_Manager/ ).

TECManager is an *extremely* simple package.  It has one function and a  
bunch of constants.  It's much smarter and more complete than the mac  
encoding packages that come with Python.

Example usage:

 > >> import TECManager as TM
 > >> TM.ConvertToUnicode('\xa5', script=TM.smRoman) # convert a macRoman  
bullet to a unicode bullet
u'\u2022'
 > >> TM.ConvertToUnicode('\xde', script=TM.smHebrew) # convert a  
smHebrew HEBREW POINT QAMATS, alternate form "qamats qatan"
u'\u05b8\uf87f'

Of course, it works with more than one character at a time.

homepage:
	http://undefined.org/python/

pydoc documentation:
	http://undefined.org/python/TECManager-0.1-pydoc.html

source tarball:
	http://undefined.org/python/TECManager-0.1.tar.gz

PackageManager URL (Python 2.3 - 10.2.x):
	http://undefined.org/python/pimp/darwin-6.6-Power_Macintosh.plist

-bob


_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@[...].org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved