Skip to content

正则表达式对utf-8处理有问题 #12

@My-Responsitories

Description

@My-Responsitories

platform: Windows

from danmakuC.ass import Ass
import re

regex = '[人12a34b]'
text = '从'

print(re.search(regex, text))
# None
ass = Ass(1920, 1080, 0, 'sans-serif', 25, 1, 5, 5, regex, False)
print(ass.add_comment(0, 0, text, 25, 0, 0xffffff))
# False

re模块未匹配, 但add_comment里被过滤了, 可能是的utf-8为b'\xe4\xba\xba', b'\xe4\xbb\x8e', []内被按字节匹配了

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions