[MPlayer-users] Playing an URL with special characters, charset problem

Clément Bœsch ubitux at gmail.com
Mon Jan 10 17:06:27 CET 2011


On Mon, Jan 10, 2011 at 11:58:41PM +0900, Arthur Helfstein Fragoso wrote:
> Hello,
> 

Hi,

> 
> so after using a sniffer (Wireshark) to see the socket request
> packet, I got the conclusion that mplayer is getting the right
> input.
> input:
> ./mplayer "http://translate.google.com/translate_tts?tl=zh&q=%E4%BD%A0%E5%A5%BDhao"
> 
> mplayer output says: "Playing http://translate.google.com/translate_tts?tl=zh&q=%E4%BD%A0%E5%A5%BDhao."
> but it makes the wrong http request:
> "/translate_tts?tl= zh&q=......hao"
> 
> ......hao = e4 bd a0 e5 a5 bd 68 61 6f
> 
> it should be:
> 
> "translate_tts?tl=zh&q=%E4%BD%A0%E5%A5%BDhao"
> 
> %E4%BD%A0%E5%A5%BDhao=
> 25 45 34 25 42 44 25 41 30 25 45 35 25 41 35 25 42 44 68 61 6f
> 

I don't understand what's wrong:

☭ php -r 'echo urldecode("%E4%BD%A0%E5%A5%BDhao");'|hexdump -C
00000000  e4 bd a0 e5 a5 bd 68 61  6f                       |......hao|

Why should it be the result you expect? I'm not saying you're wrong, I'd
just like to know how we should handle that; could you explain it a bit?

[...]

-- 
Clément B.


More information about the MPlayer-users mailing list