Re: Why does the "".join(r) do this?
From: Ivan Voras (ivoras_at___geri.cc.fer.hr)
Date: 05/20/04
- Next message: David MacQuigg: "Re: Unification of Methods and Functions"
- Previous message: Jeff Learman: "shell script stdout to python string?"
- In reply to: Peter Otten: "Re: Why does the "".join(r) do this?"
- Next in thread: John Roth: "Re: Why does the "".join(r) do this?"
- Reply: John Roth: "Re: Why does the "".join(r) do this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 May 2004 20:36:37 +0200
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?)
-- 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: David MacQuigg: "Re: Unification of Methods and Functions"
- Previous message: Jeff Learman: "shell script stdout to python string?"
- In reply to: Peter Otten: "Re: Why does the "".join(r) do this?"
- Next in thread: John Roth: "Re: Why does the "".join(r) do this?"
- Reply: John Roth: "Re: Why does the "".join(r) do this?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|