Replacing utf-8 characters

Mike no at spam
Wed Oct 5 15:40:29 EDT 2005


Steve Holden wrote:

>>>
> You must be doing *something* wrong:
> 
>  >>> link = 
> "/news/newsArticle.aspx?type=businessNews&storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_UK-AIRLINES-BA.xml" 
> 
>  >>> link = link.replace('&','&')
>  >>> link
> '/news/newsArticle.aspx?type=businessNews&storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_UK-AIRLINES-BA.xml' 
> 
>  >>>
> 
> regards
>  Steve

What you and I typed was ascii. The value of link came from importing 
that utf-8 web page into that variable.  That is why I think it is not 
working.  But not sure what the solution is.



More information about the Python-list mailing list