[Tutor] Using special characters in Python

Ole Jensen learning.python@dbmail.dk
Fri Feb 21 11:18:00 2003


I would like to now if it is possible to use special characters in python
especially in strings.

The problem is that in Danish (and Norwegian) we have some characters in the
alphabet that doesn not exist in the english one, i.e. æ, ø, and å (in case
you can see them correctly here they are in html: æ and ø and
å)

I've been trying to search the subject both on google and through the
python.org site, but unsuccesfully... unforunetly.

currently when i try to save the program using these special charaters, i
get this error message:
Traceback (most recent call last):
  File "D:\Programmer\python\lib\lib-tk\Tkinter.py", line 1300, in __call__
    return apply(self.func, args)
  File "D:\PROGRA~1\python\Tools\idle\IOBinding.py", line 128, in save
    if self.writefile(self.filename):
  File "D:\PROGRA~1\python\Tools\idle\IOBinding.py", line 151, in writefile
    chars = str(self.text.get("1.0", "end-1c"))
UnicodeError: ASCII encoding error: ordinal not in range(128)

So hopefully any of you know whether it is possible or not and if it is I
hope you can supply a link to a list of commands for special characters.

thanks in advance
Ole