python中的符号是否都是英文符号_使用Python处理CSV中的非标准美国英语字符和符号 - IT屋-程序员软件开发技术分享社区...

I have a list of store names, with a few thousand names, some of which have non-standard American English characters that are posing a problem.

For example, my input file looks like this:

store_name

yéché

Ázak

ótndle

I want the output file to actually look like this (I think Googledocs made this happen, btw):

store_name new_store_name

yéché yéché

Ázak Ãzak

ótndle ótndle

There are only about 10 such rules that convert the non-standard American English character into this format, so I went through and did control f in excel to make them. But I'd like to be able in the future to do things like this computationally, and was just wondering if there is a quick way of doing this using Python. To be clear, what I want to do is make:

é become é

Á become Ãi

解决方案print a

péché

Álak

óundle

print a.decode('latin9').encode('utf8'),

péché

Ãlak

óundle

I had to do the reverse...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值