简体   繁体   English

从 .txt 文件中删除/过滤/解码这些字符的最佳 python 方法?

[英]Best python way to remove/filter/decode these characters from the .txt file?

I am getting this data from a DB table and the encoding does not seem to be working.我从数据库表中获取这些数据,并且编码似乎不起作用。

  • é ©
  • é é ??
  • Ú é é éé Ú é é éé
  • î éé î éé
  • é ©
  • ç é ÍÔ

I tried changing the encoding of the file in Sublime but that wouldn't work.我尝试在 Sublime 中更改文件的编码,但这不起作用。 I also tried a few encode/decode combinations I found here but nothing is resolving it.我还尝试了一些在这里找到的编码/解码组合,但没有解决它。

I am using Teradata.我正在使用 Teradata。

Any idea how to figure out what the encoding is and how to set it to something readable?知道如何弄清楚编码是什么以及如何将其设置为可读的吗? Preferably in Latin alphabet.最好用拉丁字母。

I think that you should tell to MySQL that the connection must be made in UTF-8.我认为您应该告诉 MySQL 必须在 UTF-8 中进行连接。 You can check this 2 answers:你可以检查这2个答案:
first answer 第一个答案
second answer 第二个答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM