Bugzilla – Bug 17784
CLI requests use wrong encoding
Last modified: 2011-11-30 01:57:34 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.
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?
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