regex - Strip Trademark Symbol from string Python -


i'm trying prep data designer. i'm pulling data out of sql server python on windows machine (not sure if os important). how make string 'official trademark™' = 'official trademark'? also, further information/reading on unicode or pertinent subject matter me become little more independent. help!

edited:

perhaps should have included code. i'm getting error during run time: 'unicodedecodeerror: 'ascii' codec can't decode byte 0x99 in position 2:ordinal not in range(128).' here code:

row.note = 'tm™ data\n' t = row.note t = t.rstrip(os.linesep).lstrip(os.linesep) t = t.replace(u"\u2122",'') 

the trademark symbol unicode character u+2122, or in python notation u"\u2122".

just search , replace:

'string'.replace(u"\u2122", '') 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -