[Pythonmac-SIG] Umlaut/nonASCII in python2.2.1 from fink
Peter Paul Sint
sint@oeaw.ac.at
Fri, 23 Aug 2002 15:24:14 +0200
Installed python2.2.1 from fink on MacOS10.1.5
http://fink.sourceforge.net/pdb/package.php/python
Unix terminals do not allow entering Umlauts/non-ascii
xu=3D"=E4=F6=FC=DF" # "Umlaut a, umlaut o, umlaut u, unvoiced s"
In a script I can write
x=3D"abcd"
print x
xu=3Du"=E4=F6=FC=DF"
xu =3Dxu.encode("latin-1")
print xu
In Terminal this results in
psint% python scriptpython.py
abcd
????
%
However,
python scriptpython.py > newfile.txt
results in a file with readable non-ascii (as long as Latin-1).
This is a solution, although non interactively.
Obviously there are two IDE solutions which may solve the problem
http://www.cwi.nl/~jack/macpython.html
Do they?
As I assume you need to download a separate python for this. I am not=
especially keen to remove the existing fink-python or to install a second o=
ne.
Is there a simple solution with the line-interface python automating the=
editor to pyton to editor process. XDarwin+WindowMaker is installed but I=
have no experience with it. Does emacs support umlauts/non-ascii (I guess=
it could be used to support the transfer but I know near to nothing about=
its advanced features to achieve this).
There seems to be a similar solution for TeX (tetex) and BBEdit
http://www.kiffe.com/textools.html or
http://www.cs.man.ac.uk/~franconi/mac-emacs/ .
There is a Python FAQ entry (4.01.)
http://www.python.org/cgi-bin/faqw.py?req=3Dshow&file=3Dfaq04.102.htp
which may hint to a more direct solution avoiding Latin-1 but I am not yet=
quite sure how. (This does not change terminal but maybe output to files?)
Peter