Note that ... there are a number of different formats that use \u
escapes - Python unicode literals (which unicode-escape handles), Java
properties, JavaScript string literals, JSON, and so on. It is
important to know which one you are dealing with because they all have
slightly different rules about what other escapes are valid.
unicode-escape may or may not be a valid way of parsing that data
depending on where it comes from.
json包含转义的unicode字符。您可以使用
unicode_escape
编解码器将它们解码为实际的unicode字符:请注意,虽然这通常可以工作,但根据unicode转义的来源,您可能会遇到基本多语言平面(U+0到U+FFFF)之外的字符的问题。我从一条评论中引用了用户@bobince的一句话:
相关问题 更多 >
编程相关推荐