Re: Why does the "".join(r) do this?
From: John Roth (newsgroups_at_jhrothjr.com)
Date: 05/20/04
- Next message: John J. Lee: "Re: Serious trouble with https (Python 2.2.3 & 2.3.3), How to check for working ssl?"
- Previous message: David MacQuigg: "Re: Unification of Methods and Functions"
- In reply to: Ivan Voras: "Re: Why does the "".join(r) do this?"
- Next in thread: Peter Otten: "Re: Why does the "".join(r) do this?"
- Reply: Peter Otten: "Re: Why does the "".join(r) do this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 May 2004 14:56:57 -0400
"Ivan Voras" <ivoras@__geri.cc.fer.hr> wrote in message
news:c8itrm$epg$1@bagan.srce.hr...
> Peter Otten wrote:
>
> > Skip Montanaro wrote:
> >
> >
> >>Try
> >>
> >> u"".join(r)
> >>
> >>instead. I think the join operation is trying to convert the Unicode
bits
> >>in your list of strings to strings by encoding using the default codec,
> >>which appears to be ASCII.
> >
> >
> > This is bound to fail when the first non-ascii str occurs:
>
> Is there a way to change the default codec in a part of a program?
> (Meaning that different parts of program deal with strings they know are
> in a specific different code pages?)
Does the encoding line (1st or second line of program) do this?
I don't remember if it does or not - although I'd suspect not.
Otherwise it seems like a reasonably straightforward function
to write.
John Roth
>
>
> --
> C isn't that hard: void (*(*f[])())() defines f as an array of
> unspecified size, of pointers to functions that return pointers to
> functions that return void.
- Next message: John J. Lee: "Re: Serious trouble with https (Python 2.2.3 & 2.3.3), How to check for working ssl?"
- Previous message: David MacQuigg: "Re: Unification of Methods and Functions"
- In reply to: Ivan Voras: "Re: Why does the "".join(r) do this?"
- Next in thread: Peter Otten: "Re: Why does the "".join(r) do this?"
- Reply: Peter Otten: "Re: Why does the "".join(r) do this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|