You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I'm Chinese, and my system language of CentOS is Chinese yet. I use fpp with git status, but all of Chinese character are become messy code, it's very unfriendly. Is there has any solution to solve it? THX very much~
Oh yeah there might not be utf8 support. Can you try using python3?
From: Younger <notifications@github.com>
Reply-To: facebook/PathPicker <reply@reply.github.com>
Date: Wednesday, November 21, 2018 at 7:31 PM
To: facebook/PathPicker <PathPicker@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [facebook/PathPicker] Chinese language support! (#294)
Hey,
I'm Chinese, and my system language of CentOS is Chinese yet. I use fpp with git status, but all of Chinese character are become messy code, it's very unfriendly. Is there has any solution to solve it? THX very much~
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#294>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABFRn_C2UD95O01qHrbF0sgOv0huQiSDks5uxgxhgaJpZM4Yuj42>.
It's actually a problem of using regex to match a filename that includes unicode. I see most regex are a-z.A-Z0-9. It will not match the unicode, only work with ASCII.
For Unicode (str) patterns:
Matches Unicode word characters; this includes most characters that can be part of a word in any language, as well as numbers and the underscore. If the ASCII flag is used, only [a-zA-Z0-9_] is matched.
if change the regex to JUST_FILE = re.compile(r"([@%+\w\-_]+\.[a-zA-Z]{1,10})(\s|$|:)+"), it can match the file named 测试.txt.
Additionally, there is a filename-regex package in javascript. It uses more looser regex.
module.exports = function filenameRegex() {
return /([^\\\/]+)$/;
};
Activity
pcottle commentedon Nov 23, 2018
sbraveyoung commentedon Nov 24, 2018
Oh, thanks a lot. I modify the fpp scripts that 'python' to 'python36', then this problem has disappeared.
muyinliu commentedon Apr 30, 2021
Still NOT work with
git statuswith path contains Chinese characters. Reproduce with commands:=>
Note: fpp v0.9.2
Please reopen this issue.
Hanaasagi commentedon Jun 18, 2021
@muyinliu @KapJI
It's actually a problem of using regex to match a filename that includes unicode. I see most regex are
a-z.A-Z0-9. It will not match the unicode, only work with ASCII.https://github.com/facebook/PathPicker/blob/e0d5cfc29ac67fcd1c0714275afdf0a80349d577/src/pathpicker/parse.py#L32
In Python3
\wcan do this, but not all unicode.if change the regex to
JUST_FILE = re.compile(r"([@%+\w\-_]+\.[a-zA-Z]{1,10})(\s|$|:)+"), it can match the file named测试.txt.Additionally, there is a filename-regex package in javascript. It uses more looser regex.