python - 使用 Redis 和 Python 保存德语变音符号
问题描述
我用 python 保存了一些 URL,不幸的是它们包含德语变音符号(ä、ö、ü)。如果它现在保存在 Redis 中,而不是 "baden-württemberg" 我得到 "baden-w\xc3\xbcrttemberg"
redis_client = redis_con()
# seitenlink in redis speichern
for i in range(0, seitenAnzahl):
link = url[:-6] + (str(i)) + ".html"
link_hash = hashlib.md5(str(link).encode('utf-8', 'ignore')).hexdigest()
reg = "tpl_regioLinks"
redis_client.hset(reg, link_hash, link)
解决方案
推荐阅读
- python - 用 NaN 替换数据框中的值列表
- java - “java.lang.Class.getMethod()”方法中“parameterTypes”的解释和正确格式
- c# - 注册控制器和托管服务时使用 InstancePerLifetimeScope 或 InstancePerDependency?
- excel - 如何使用 VBA 将我的图片放置在现有 powerpoint 幻灯片的幻灯片中心?
- python - Pygame TypeError: join() 参数必须是 str、bytes 或 os.PathLike 对象,而不是“Surface”
- javascript - d3.nest().entries() 中的方程有什么作用?
- python-3.x - Convert date with string component to date time format in python
- php - 如何修复 PHP 错误:“调用未定义函数 posix_strerror()”
- python-3.x - boto3.client 和 pymysql.connect 的区别
- go - GoLand 没有检测到 $GOPATH/pkg/mod 下的供应商包?