Unicode Hell

Peter Maas fpetermaas at netscape.net
Fri Nov 7 04:28:01 EST 2003


Stuart schrieb:
> What I really want to do is replace a field place holder with those values.
> So if we have a string
> cReplaceString = "I want to replace #here#"
> I'd like to replace the #here# with the values of a (or Óçâ߁)

# assign a unicode literal (u"...") to cReplaceString:
cReplaceString  = u"I want to replace #here#"
cNewString = cReplaceString.replace(u"#here#",u"Óçâß")

Perhaps you have to ecncode the chineses characters like \uabcd
whith a,b,c,d as hex digits. My editor has problems with chinese
characters.

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------






More information about the Python-list mailing list