Bug 16830 - CLI returns double-encoded UTF-8 for metadata when locale not using UTF-8 encoding
: CLI returns double-encoded UTF-8 for metadata when locale not using UTF-8 enc...
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: 7.6.0
: PC All
: P2 normal (vote)
: 7.6.0
Assigned To: Alan Young
http://forums.slimdevices.com/showthr...
: charset_issues
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-26 23:08 UTC by Alan Young
Modified: 2011-05-12 15:05 UTC (History)
2 users (show)

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Young 2011-01-26 23:08:45 UTC
See referenced forum thread.

Problem appears to be Windows specific.

Current as of 7.6 r31813
Comment 1 SVN Bot 2011-01-27 03:38:30 UTC
 == Auto-comment from SVN commit #31847 to the slim repo by ayoung ==
 == http://svn.slimdevices.com/slim?view=revision&revision=31847 ==

Fixed bug 16830: CLI returns double-encoded UTF-8 for metadata when local not using UTF-8 encoding 
Fixes for the original problem:
Fix encoding of simple values in Slim::Control::Request::renderAsArray().
All input to renderAsArray() should already be in perl internal character-string format, so just use Slim::Utils::Unicode::utf8encode() instead of Slim::Utils::Unicode::from_to().

Fixes to ensure that the CLI charset param (continues to ?) work with the changes above.
Slim::Control::Stdio::array_to_string() needs to allow output character-set encodings other than just UTF-8.
The current locale has nothing to do with encoding CLI results.

Fixes to related issues discovered as part of the investigation:
Slim::Utils::Unicode::encodingFromString() will return 'utf8' immediately if the flag is already set on the supplied string, unless this test is defeated by a parameter. This will avoid the problem of double-encoding when the encoding is already known.
utf8::decode() is not idempotent so protect against this in a few places.
Comment 2 Bradley D. Wall 2011-05-12 15:05:07 UTC
Verified fixed in 7.6.0, 32398