Bug 17784 - CLI requests use wrong encoding
: CLI requests use wrong encoding
Status: UNCONFIRMED
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: 7.6.1
: PC Windows 7
: -- normal (vote)
: 7.7.x
Assigned To: Andy Grundman
: charset_issues
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-23 02:51 UTC by AndrewFG
Modified: 2011-11-30 01:57 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AndrewFG 2011-11-23 02:51:35 UTC
The CLI documentation says that CLI _responses_ are encoded using percent escaped UTF-8 character encoding; and tests confirm that the CLI does indeed comply to the documentation.

BUT -- by analogy -- you would expect that that CLI _requests_ must support percent escaped UTF-8 character encoding. However it seems that the CLI does NOT comply with this. Rather it seems to require _requests_ to be encoded using percent escaped ANSI encoding (based on the PC's active Code Page).

Note: for 99% of CLI requests you would not notice any difference, since most requests are using only US ASCII characters in which have the same codes in ANSI and in UTF-8

However in the case of <player> playlist add "track_url" "track_title" it is quite possible that track_title would be a non US ASCII text. And indeed in such case providing a UTF-8 encoded text results in a garbled text display on the player UI, whereas providing an ANSI ACP encoded text results in correct text on the player UI.
Comment 1 Andy Grundman 2011-11-24 14:38:31 UTC
I checked the docs and it seems all the "charset" stuff was removed, and there is only a small mention that all strings are UTF-8. I'd be OK to change the request handling, but I'm a bit afraid of breaking a client that might depend on this behavior. Can you paste some examples of requests/responses you've made that aren't correct?
Comment 2 AndrewFG 2011-11-26 02:16:04 UTC
Here are two examples; one bad and one good...

Request is UTF-8 Encoded 
========================
00:04:20:10:0a:24 playlist add http://192.168.1.31:31416/play.flc Engeg%C3%A5rdkvartetten

Response is Garbled
===================

00%3A04%3A20%3A10%3A0a%3A24 playlist add http%3A%2F%2F192.168.1.31%3A31416%2Fplay.flc Engeg%C3%83%C2%A5rdkvartetten

++++++++++++

Request is ANSI (ACP) Encoded 
=============================
00:04:20:10:0a:24 playlist add http://192.168.1.31:31416/play.flc Engegårdkvartetten

Response is UTF-8 Encoded
=========================
00%3A04%3A20%3A10%3A0a%3A24 playlist add http%3A%2F%2F192.168.1.31%3A31416%2Fplay.flc Engeg%C3%A5rdkvartetten