Index: HTML/EN/html/docs/cli-api.html =================================================================== --- HTML/EN/html/docs/cli-api.html (revision 31846) +++ HTML/EN/html/docs/cli-api.html (working copy) @@ -24,8 +24,7 @@ The end of line separator is line feed (<LF> ASCII decimal 10, hexadecimal 0x0A). The server accepts LF, CR or 0x00 (or any combination thereof) as end of line, and replies with whatever was used for the command. - For strings, Squeezebox Server uses the UTF-8 charset. Some extended queries allow - to return data in a different charset. + For strings, Squeezebox Server uses the UTF-8 character-set encoding.

To use the command line interface interactively, use the telnet @@ -54,6 +53,7 @@

  • Added genre_id tagged parameter to genres.
  • Added year tagged parameter to years.
  • Added return_top tagged parameter to musicfolder.
  • +
  • Removed the charset tagged parameter from all commands that supported it.

  • @@ -555,22 +555,12 @@
  • - Extended queries accepting the "charset" parameter normally - return field values in utf8, Perl's lenient version of UTF-8. The value - of this parameter is sent as is to Perl's Encode plumbing. As a - consequence, any encoding known to Perl is valid, for example - "iso-8859-1" (the web standard), "cp437" (MS-DOS), - etc. More exotic choices like "UTF-16" or "shiftjis" - are possible. Note that the server will crash if the encoding is - unknown. -
  • - -
  • - All paths and URLs, for example the ones returned by the query + All paths returned as URLs, for example the ones returned by the query "songinfo" are double URL escaped. To get a useable path (that you can use with your file system), you will need to unescape the field twice. Also note the URLs are not translated - into Unicode (or into any other charset requested). + or re-encoded: they use the encoding of the underlying filesystem API, + typically (but not necessarily) the current locale.
  • @@ -1988,15 +1978,6 @@ - charset - - - Character set to use for the data. See - charset notes above. - - - - screen @@ -2409,15 +2390,6 @@ Comma separated list of preference values to return (for each player). - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -2705,15 +2677,6 @@ Description - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -3052,15 +3015,6 @@ by a letter (see below). The default value is empty. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -3238,15 +3192,6 @@ by a letter (see below). The default value is empty. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -3454,15 +3399,6 @@ by a letter (see below). The default value is "l". - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -3685,15 +3621,6 @@ Return only the specified year. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -3824,15 +3751,6 @@ by a letter (see below). The default value is empty. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -3976,15 +3894,6 @@ by a letter (see below). The default value is empty. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -4122,11 +4031,6 @@ for a list of possible fields and their identifying letter). The default tags value for this command is "gald". - - charset - Character set to use to return data. See - charset notes above. -

    Returned tagged parameters:

    @@ -4211,15 +4115,6 @@ return a "overwritten_playlist_id" parameter. - - - -
    - charset - - Character set to use to return data. See - charset notes above. -

    Returned tagged parameters: @@ -4293,15 +4188,6 @@ The name of the playlist (without .m3u). - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -4538,15 +4424,6 @@ url (u) and the multi-valued tags for genre(s) (G & P) and artists (A & S) - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -5155,15 +5032,6 @@ possible only if tracks are defined and for a single album. - - - charset - - - Character set to use for the data. See - charset notes above. - -

    Returned tagged parameters: @@ -5289,15 +5157,6 @@ Search string - - - charset - - - Character set to use for the data. See - charset notes above. - -

    Returned tagged parameters: @@ -6284,15 +6143,6 @@ Tag Description - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -6657,15 +6507,6 @@ - charset - - - Character set to use to return data. See - charset notes above. - - - - subscribe @@ -7128,15 +6969,6 @@ - charset - - - Character set to use to return data. See - charset notes above. - - - - subscribe @@ -8071,11 +7903,6 @@ To get all possible alarms, use "all". To get only enabled alarms, use "enabled" - - charset - Character set to use to return data. See - charset notes above. -

    Returned tagged parameters:

    @@ -8241,15 +8068,6 @@ Field used to sort results, typically "name". - - - -
    - charset - - Character set to use to return data. See - charset notes above. -

    Returned tagged parameters: @@ -8409,15 +8227,6 @@ If set to 1, urls are returned by the query, otherwise they aren't. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: @@ -8736,15 +8545,6 @@ If set to 1, urls are returned by the query, otherwise they aren't. - - - charset - - - Character set to use to return data. See - charset notes above. - -

    Returned tagged parameters: Index: Slim/Control/Stdio.pm =================================================================== --- Slim/Control/Stdio.pm (revision 31847) +++ Slim/Control/Stdio.pm (working copy) @@ -128,8 +128,9 @@ # add clientid if there is a client unshift @elements, $clientid if defined $clientid; + # escape all the terms - do { utf8::encode($_) if utf8::is_utf8($_); $_ = URI::Escape::uri_escape($_) } foreach @elements; + map { $_ = URI::Escape::uri_escape_utf8($_) } @elements; # join by space and return! return join " ", @elements; Index: Slim/Control/Request.pm =================================================================== --- Slim/Control/Request.pm (revision 31847) +++ Slim/Control/Request.pm (working copy) @@ -2267,18 +2267,7 @@ sub fixEncoding { my $self = shift || return; - my $encoding = ${$self->{'_params'}}{'charset'} || return; - - while (my ($key, $val) = each %{$self->{'_params'}}) { - - if (!ref($val)) { - - # wrap decode in eval, as an incorrect encoding type could hang CLI - eval { ${$self->{'_params'}}{$key} = Slim::Utils::Unicode::decode($encoding, $val) }; - - $@ && $log->is_warn && $log->warn($@); - } - } + map {utf8::decode($_) unless ref $_ || utf8::is_utf8($_)} values %{$self->{'_params'}}; } ################################################################################ @@ -2312,7 +2301,6 @@ # returns the request as an array sub renderAsArray { my $self = shift; - my $encoding = shift; if (!$self->{'_useixhash'}) { logBacktrace("request should set useIxHashes in Slim::Control::Request->new()"); @@ -2335,8 +2323,6 @@ # no output next if ($key =~ /^__/); - $val = Slim::Utils::Unicode::utf8encode($val, $encoding) if $encoding; - if ($key =~ /^_/) { push @returnArray, $val; } else { @@ -2358,8 +2344,6 @@ while (my ($key2, $val2) = each %{$hash}) { - $val2 = Slim::Utils::Unicode::utf8encode($val2, $encoding) if $encoding; - if ($key2 =~ /^__/) { # no output } elsif ($key2 =~ /^_/) { @@ -2376,9 +2360,6 @@ if (ref $val eq 'ARRAY') { $val = join (',', @{$val}) } - elsif ($encoding && !ref $val) { - $val = Slim::Utils::Unicode::utf8encode($val, $encoding); - } if ($key =~ /^_/) { push @returnArray, $val; Index: Slim/Plugin/CLI/Plugin.pm =================================================================== --- Slim/Plugin/CLI/Plugin.pm (revision 31847) +++ Slim/Plugin/CLI/Plugin.pm (working copy) @@ -33,7 +33,7 @@ # subscribe # Other CLI queries/commands are handled through Request.pm # -# This module also handles parameters "charset" and "subscribe" +# This module also handles parameter "subscribe" my $cli_socket; # server socket my $cli_socket_port = 0; # CLI port on which socket is opened @@ -565,7 +565,7 @@ return if !defined $request; - # fix the encoding and/or manage charset param + # fix the encoding $request->fixEncoding(); # remember we're the source and the $client_socket @@ -702,9 +702,8 @@ $client_socket = $request->connectionID() unless defined $client_socket; - my $encoding = $request->getParam('charset') || undef; # default is utf8 - my @elements = $request->renderAsArray($encoding); + my @elements = $request->renderAsArray(); my $output = Slim::Control::Stdio::array_to_string($request->clientid(), \@elements); Index: Changelog7.html =================================================================== --- Changelog7.html (revision 31846) +++ Changelog7.html (working copy) @@ -50,9 +50,10 @@
    -

  • Scanner Changes:
  • +
  • Other Major Changes: