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

Possible file creation failure for filename in CJK in UTF-8 #76

Open
gujm opened this issue Sep 9, 2022 · 0 comments
Open

Possible file creation failure for filename in CJK in UTF-8 #76

gujm opened this issue Sep 9, 2022 · 0 comments

Comments

@gujm
Copy link

gujm commented Sep 9, 2022

I found the filename length issue still exists when processing long titles in CJK languages.

#31 createFilename() in class FileNameUtils uses string.length() to ensure the file name is less than 127. However, when the title is in CJK language in UTF-8 format, length() checks the number of characters instead of bytes. Although the CJK title may be of less than 127 characters, the number of bytes it occupies could exceed 255.

Perhaps String.getBytes().length be to used but with proper truncation of UTF-8 string?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant