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

fix(downloader): Korean filename is broken on non-macOS devices #1297

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

nnnlog
Copy link
Contributor

@nnnlog nnnlog commented Oct 10, 2023

Abstract

There are various unicode normalization methods in UTF-8. See here in Korean example. Windows uses NFC, but MacOS uses NFD. If downloading music that includes Korean in the title, the file name in Windows is seen as below.
image
This PR resolves the above problem. See below.
image

Changes

filenamify returns always file name normalized NFD, not depending on OS. There is no standard method for separating OS in Javascript Runtime Environment, therefore I think it is not a good idea to modify filenamify. This PR checks the current OS, then if not MacOS, normalizes the file name to NFC.

Also, note that this PR includes fixing chore typo in readme.md.

Copy link
Collaborator

@JellyBrick JellyBrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JellyBrick JellyBrick added the bug Something isn't working label Oct 10, 2023
@JellyBrick JellyBrick changed the title Fix downloader Korean filename on Windows, etc. fix(downloader): Korean filename is broken on non-macOS devices Oct 10, 2023
@JellyBrick JellyBrick merged commit 2294102 into th-ch:master Oct 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants