1、参考:https://blog.csdn.net/weixin_39994949/article/details/110989657
2、代码:
str_without_b = '\u00ce\u00de'
str = str_without_b.encode('raw_unicode_escape')
str.decode('gb2312')
3、
>>t = '中文测试=123.pdf'
>>t.encode('raw_unicode_escape')
b'\\u4e2d\\u6587\\u6d4b\\u8bd5=123.pdf'
>>t1 = t.encode('raw_unicode_escape')
>>t1.decode()
'\\u4e2d\\u6587\\u6d4b\\u8bd5=123.pdf'
>>t1.decode('raw_unicode_escape')
'中文测试=123.pdf'