【发布时间】:2014-06-14 10:08:44
【问题描述】:
d = {
"key": "Impress the playing crowd with these classic "
"Playing Cards \u00a9 Personalized Coasters.These beautiful"
" coasters are made from glass, and measure approximately 4\u201d x 4\u201d (inches)"
".Great to look at, and lovely to the touch.There are 4 coasters in a set.We have "
"created this exclusive design for all card lovers.Each coaster is a different suit, "
"with the underneath.Make your next Bridge, or Teen Patti session uber-personal!"
"Will look great on the bar, or any tabletop.Gift Designed for: Couples, Him, "
"HerOccasion:Diwali, Bridge, Anniversary, Birthday"}
我已经尝试过替换功能,但没有用。
s = d[key].replace('\u00a9','')
【问题讨论】:
-
请注意
\u00a9是版权符号。删除可能会产生法律后果。 -
同意,删除您无法理解的字符似乎是解决此问题的错误方法。 (实际文本有更严重的问题,但我想这超出了本网站的范围。)
-
请解释“但没用”。发生了什么?你预计会发生什么?
-
@André 写出来作为答案,这似乎是 OP 正在寻找的。span>
-
你不应该删除 unicode 字符 - 你必须使用 DFEAL - 请阅读:joelonsoftware.com/articles/Unicode.html
标签: python string dictionary