<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Am 20.11.2010 06:53, schrieb Mikael B:
<blockquote cite="mid:SNT108-W487B682A1465F9F910635833B0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
Hi.<br>
<br>
I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I
try to use<br>
unicode to get swedish characters. I've checked wikipedia.<br>
utf-8 is said to be an unicode encoding..<br>
<br>
this is the test program:<br>
<br>
# -*- coding: utf-8 -*-<br>
<br>
import readline<br>
<br>
s=raw_input(u'Månadslön:')<br>
<br>
and this is the output:<br>
<br>
Traceback (most recent call last):<br>
File "test_uni.py", line 5, in <module><br>
s=raw_input(u'Månadslön:')<br>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5'
in position 1: ordinal not in range(128)<br>
<br>
I'm doing something wrong...<br>
<br>
Mikael<br>
<br>
</blockquote>
Your console is not unicode ready.<br>
Please take a look at the locale command and vars like<br>
LC_ALL, LC_LANG etc.<br>
</body>
</html>