Why does the "".join(r) do this?

Ivan Voras ivoras at __geri.cc.fer.hr
Thu May 20 14:36:37 EDT 2004


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.



More information about the Python-list mailing list