-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Setting global text coding in Liquidsoap #3231
Comments
Hi, Have you tried setting environment variables? |
Nevermind, I found the function we're using. Hold on! |
I can't test #3232 because the CI that builds win32 binaries is fail, and I can't build Liquidsoap on my computer right now. @toots |
@rsp4jack This one should be good now: https://github.com/savonet/liquidsoap/actions/runs/5562944497 |
It fails on a very simple test.
|
On second thoughts I'm not sure that this would fix your issue. Also, looking at the code, I'm not sure if the fact that liquidsoap is returning log and playlog in By default, strings in liquidsoap are actually assumed to be utf8. This is the encoding expected to be returned by string recoding functions ( In both cases, if we fail to convert or escape, we fallback to the original string. I would imagine that, in your case, the strings are In this case, the only approach we could do is to fix the logs only. For the rest of the internal logic, we would have to try & convert all strings entering the program through any API (file system calls, etc), which seems pretty impossible. I think the most reasonable thing to do is to allow conversion of log entries. This is done in #3238, which adds the following:
Windows builds are available here: https://github.com/savonet/liquidsoap/actions/runs/5583458223 let me know if this works for you. |
That's right. I found that some data in the log is in UTF-8, some is in GB2312. I think Liquidsoap should try to detect strings' coding (like metadata, paths, files, etc.) and convert them into UTF-8. This seems impossible now, but may be possible in the future. Also, playlog needs a
I can't reproduce it again, even |
* Add settings.metadata.recode * Add doc. Fixes: #3231
This is already done but cannot be done everywhere. Typically, for filenames and path, we do need to keep them in the system's encoding to prevent errors when calling file manipulation functions.
I've added a systematic string recode to metadata extractors, this should take care of most of the cases. Also added some doc to explain the situation and document the new settings.
I'll look at this very shortly. |
* Add settings.metadata.recode * Add doc. Fixes: #3231
* Add settings.metadata.recode * Add doc. Fixes: #3231
* Add settings.metadata.recode * Add doc. Fixes: #3231
* Add settings.metadata.recode * Add doc. Fixes: #3231
* Add settings.metadata.recode * Add doc. Fixes: #3231
* Cleanup tutils and tests logic. * * Add settings.log.recode and settings.log.recode.encoding. * Add settings.metadata.recode * Add doc. Fixes: #3231
I am using Windows 10 and system language is set to Simplified Chinese. The default code page is 936.
Liquidsoap writes logs (including file and console) and playlog in GB2312 (The default text coding under code page 936). But I want Liquidsoap to write them in a specific coding. i.e. set a global text coding.
For example:
The text was updated successfully, but these errors were encountered: