[Tutor] Unicode trouble

2005-12-04 Thread Øyvind
>> Might the problem only be related to Win32com, not Python since Python >> prints it without trouble? >That's another issue. First you need to know what you are starting with. >You really should read this: >The Absolute Minimum Every Software Developer Absolutely, Positively Must >Know About U

Re: [Tutor] Unicode trouble

2005-12-01 Thread Kent Johnson
Øyvind wrote: >>The important question is, what is actual encoding of your source data? >> >>>Is there anything else I could try? > > >>Understand why the above question is important, then answer it. Until you > > do >you are just thrashing around in the dark. > > The source is a text-document

[Tutor] Unicode trouble

2005-12-01 Thread Øyvind
>The important question is, what is actual encoding of your source data? >> >> Is there anything else I could try? >Understand why the above question is important, then answer it. Until you do >you are just thrashing around in the dark. The source is a text-document that as far as I know only co

Re: [Tutor] Unicode trouble

2005-12-01 Thread Kent Johnson
Øyvind wrote: > I tried the error='replace' as you suggested and the program made it thru > the list. However, here are some results: > > the gjenoppl�et gjenoppl� > from > the gjenoppløst det gjenoppløste > > kan v� konsentrert > from > kan være konsentrert It seems pretty clear tha

[Tutor] Unicode trouble

2005-12-01 Thread Øyvind
Michael Lange wrote: >> I haven't read all of this thread, but maybe you are trying to pass a >> non-utf8 string to the utf8 codec? >Yes, I guess that much is pretty clear - there is some data in the source >file that is not valid utf-8. I tried the error='replace' as you suggested and the progr

Re: [Tutor] Unicode trouble

2005-11-30 Thread Kent Johnson
Michael Lange wrote: > On Wed, 30 Nov 2005 13:41:54 -0500 > Kent Johnson <[EMAIL PROTECTED]> wrote: >This is the full error: >Traceback (most recent call last): > File >"C:\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", >line 310, in RunScript > ex

Re: [Tutor] Unicode trouble

2005-11-30 Thread Michael Lange
On Wed, 30 Nov 2005 13:41:54 -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: > >>>This is the full error: > >>>Traceback (most recent call last): > >>> File > >>>"C:\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > >>>line 310, in RunScript > >>>exec codeObject in __main

Re: [Tutor] Unicode trouble

2005-11-30 Thread Kent Johnson
Øyvind wrote: > Øyvind wrote: > >>>Where are you getting these errors (what line of the program)? Do you >> >>know >what kind of strings objSelection.Find.Execute() is expecting? >> >> >>>Kent >> >> >>>The program stops working and gives me these errors when I try to run it >>>when it encounters a

[Tutor] Unicode trouble

2005-11-30 Thread Øyvind
Øyvind wrote: > >>Where are you getting these errors (what line of the program)? Do you > > know >what kind of strings objSelection.Find.Execute() is expecting? > >>Kent > > >> The program stops working and gives me these errors when I try to run it >> when it encounters a non-english letter. > >>

Re: [Tutor] Unicode trouble

2005-11-30 Thread Kent Johnson
Øyvind wrote: > >>Where are you getting these errors (what line of the program)? Do you > > know >what kind of strings objSelection.Find.Execute() is expecting? > >>Kent > > > The program stops working and gives me these errors when I try to run it > when it encounters a non-english letter. >

[Tutor] Unicode trouble

2005-11-30 Thread Øyvind
>Where are you getting these errors (what line of the program)? Do you know >what kind of strings objSelection.Find.Execute() is expecting? > >Kent The program stops working and gives me these errors when I try to run it when it encounters a non-english letter. This is the full error: Traceback

Re: [Tutor] Unicode trouble

2005-11-30 Thread Kent Johnson
Øyvind wrote: > Hello. > > I am writing a program that reads in a text file, extracts each of the > words and replaces a different document with the words. It works great > until it encounter a non-english letter. > > I have tried the following: > > self.f = codecs.open(ordliste, 'r', 'utf-8') >

[Tutor] Unicode trouble

2005-11-30 Thread Øyvind
Hello. I am writing a program that reads in a text file, extracts each of the words and replaces a different document with the words. It works great until it encounter a non-english letter. I have tried the following: self.f = codecs.open(ordliste, 'r', 'utf-8') where I open the first file. And