On 7/30/06, Antonio Cavedoni <[EMAIL PROTECTED]> wrote:
> I don't know much about Vim, but it appears your ö and ä are entered
> with an encoding different than UTF-8. Python then tries to decode
> your characters thinking they might be valid UTF-8, but they are not,
> so it raises the UnicodeDecodeError.
>
> FYI: ä (LATIN SMALL LETTER A WITH DIAERESIS) in UTF-8 is \xc3\xa4,
> whereas \xe4 is its encoded form in ISO-8859-1/Latin-1 (and
> ISO-8859-10/Latin-6 as well, I haven't looked at other encodings).

It's quite possible that this is the case -- in a unix environment,
you can use the od command to see the bytewise encoding of the text
file. Use something like

  od -t x1 filename.txt

to see the individual bytes in hex.

Also, to test pythons unicode handling, try a simple file with nothing but

print u"ä"

and see how python handles the string.

> I googled a bit, and found this page [1] where it says that to set
> your Vim to the UTF-8 encoding you have to use the following command
> (note the column at the beginning):
>
> :set encoding=utf-8

The colon at the beginning of the line is to enter command mode in
vim, when you are using it interactively. It is not required in a
.vimrc file.


-- 
Regards,
Ian Clelland
<[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to