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

UnicodeEncodeError Locale Issues with UNIX #257

Open
ghost opened this issue May 17, 2018 · 2 comments
Open

UnicodeEncodeError Locale Issues with UNIX #257

ghost opened this issue May 17, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented May 17, 2018

This isn't a scdl or Python issue, but about adding support for UNIXs without UTF-8 as the default locale.

OpenBSD has a custom UTF-8 OS locale that doesn't work well with Python3. Running

import sys
sys.getfilesystemencoding()

Yields:

'ascii'

I'm not well-versed in Python, but it should be as simple as checking for filesystemencoding (OS encoding) and if it's not UTF-8, strip it down (or ask for manual renaming) for every request -- or even just default to the url scheme.

To reproduce/test this, set LC_CTYPE=ascii as an environment variable and download a track with unicode characters. I.e

LC_CTYPE=ascii scdl -l https://soundcloud.com/deadrazy/pereverni-indeedeu

Exactly like #245

@ghost
Copy link
Author

ghost commented Jun 27, 2018

Easy work-around:

export LC_CTYPE=en_US.UTF-8

Nothing really to do on the maintainer's end, it's a system issue.

@ghost ghost closed this as completed Jun 27, 2018
@flyingrub
Copy link
Collaborator

The problem with this fix is that windows doesn't send the right encoding...

@flyingrub flyingrub reopened this Jul 12, 2018
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