-
Notifications
You must be signed in to change notification settings - Fork 33
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 #63
Comments
This problem is expected to occur if you pass arguments to openSMILE with non-ASCII characters, e.g. file paths containing special characters. openSMILE does not have official support for UTF-8 in config files, at least we have not tested what happens when you use UTF-8. If you're lucky, it might work on some platforms out-of-the-box but this is something we cannot guarantee. So the recommendation from my side would be to ensure there are no special characters in file paths and openSMILE options. And in config files, there should never be the need for special characters anyway. |
Should we still switch to UTF-8 encoding in |
I wouldn't because it will be harder to debug issues due to it when the error occurs at another point with a possibly unrelated error message. In the best case, you would get the error that a file couldn't be found and you might figure out it's due to special characters in the path. |
This sounds not like a nice behavior to me, so maybe we should just raise an error if an argument (whatever argument means here ;) ) contains non-ASCII? |
Or maybe fix openSMILE to support non-ASCII. We are in the year 2022 :) |
Yes, this is what happens at the moment. Any inputs with non-ASCII characters will throw the exception reported by @felixbur. I was referring to if we just change "ascii" to "utf-8", then you might be lucky that it will work but we don't know for sure without checking the code. |
Ah, ok, but then we should update the error message. At least I'm not able to understand what is going wrong when seeing:
|
Getting an
lib/python3.9/site-packages/opensmile/core/SMILEapi.py", line 237, in
map(lambda v: bytes(str(v), "ascii"), sum(options.items(), ())))
UnicodeEncodeError: 'ascii' codec can't encode character '\u0308' in position 58: ordinal not in range(128)
Happened with python3.9 under Mac OS
To solve the error, specify the correct encoding, e.g. utf-8
The text was updated successfully, but these errors were encountered: