Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
My-Responsitories opened this issue Feb 7, 2024 · 0 comments
Open

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

My-Responsitories opened this issue Feb 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@My-Responsitories
Copy link

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', []内被按字节匹配了

@HFrost0 HFrost0 added the bug Something isn't working label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants