Bugzilla – Bug 8410
Add possibility force SqueezeCenter into UTF-8 mode where no such locale is available
Last modified: 2009-09-08 09:12:42 UTC
Created attachment 3428 [details] suggested patch to add a --forceutf8 command line flag Hello I'm suggesting a means to force SC into UTF-8 mode. On a Linux system filenames can be encoded as UTF-8 even if no UTF-8 locale is available/compiled/configured. E.g. if Samba is configured to save UTF-8 encoded filenames or the user transfers the files with UTF-8 encoded filenames to the server with no recoding, you'll end up with UTF-8 encoded filenames on the server independent from what charset is configured/available on the system (or for the user). This is the situation on many NAS. In SSODS I included a simple patch that modified the SC source to force SC to interpret the filenames as if they were UTF-8 encoded. This has worked beautifully for a long time now for all versions of SS/SC (SS 6.x - SC 7.2). The attached patch adds an command line flag --forceutf8 which does what I request. I'm not sure if it's good code, though. Regards, flip http://forums.slimdevices.com/showthread.php?p=311523
Assigned to Michael to review. Note we have a steady stream of linux users with encoding/locale problems, so I am happy to do something that might help them if it's not too risky.
AFAIK the code works as follows: if there's no LC_CTYPE environment variable or if Perl's POSIX::setlocale() fails on it, the default is C. This then lead to the default charset iso-8859-1. We could as well provide a command line option to change this default charset. Something like --default-charset=<iso-8859-1|utf8|euc-jp|...>. --force-charset would be stronger and would override a present and working LC_CTYPE environment. This would only make sense if the user is unable to change the locale settings of his system, which is not what I would expect. Hence, --default-charset, which only kicks in if there's no (working) LC_CTYPE, seems more reasonable to me. What exactly are the "encoding/locale problems"? Wrongly displayed file names?
change 21067 - thanks! I made this a "charset=xyz" option though most will ever use it to force utf8
This bug has now been fixed in the 7.1 release version of SqueezeCenter! Please download the new version from http://www.slimdevices.com if you haven't already. If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Reduce number of active targets for SC