Hi all

My first time with this forum:).

I'm running python 2.4.4 and unicode enabled wxPython on Windows XP.
I'm writing a gui application which requires users to be able to type accented characters easily into a TextCtr. To this end I have built a set of tools on a toolbar which will insert accented characters. The value of the TextCtr is then appended to a data structure consisting of nested lists. Some of the data is then extracted into a separate list which is presented in a ListBox.

Now if I run the application with python.exe it behaves nicely, presenting the list in the ListBox complete with accented characters.

But if I run it with pythonw.exe I get the dreaded 'cannot encode blah, blah, blah. Neither can I run it from Dr.Python (since it runs it with pythonw.exe).

I have included an encoding declaration at the start of the source
# -*- coding: latin-1 -*-

Any ideas what I am missing as, when tested, I really want the application to run without a console.



What an idiot I am!!!!!

Forget the above. The problem never really existed. I had assumed the problem was occurring in one place when in fact it was happening in a bit of debugging code. I've removed that and everything is fine.

I'll never learn not to make assumptions.


Just for kicks, did you try:
# -*- coding: iso-8859-15 -*-
as the first line of your code?

I thought that
# -*- coding: iso-8859-15 -*-

was just another way of declaring latin-1.

Should it make a difference?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.