Index: stream/asf_mmst_streaming.c =================================================================== --- stream/asf_mmst_streaming.c (revision 29340) +++ stream/asf_mmst_streaming.c (working copy) @@ -43,10 +43,6 @@ #include #endif -#ifndef CONFIG_SETLOCALE -#undef CONFIG_ICONV -#endif - #ifdef CONFIG_ICONV #include #endif @@ -73,6 +69,10 @@ } command_t; +#ifdef CONFIG_ICONV +char *mp_url_charset = NULL; +#endif + static int seq_num; static int num_stream_ids; static int stream_ids[MAX_STREAMS]; @@ -571,7 +571,15 @@ /* prepare for the url encoding conversion */ #ifdef CONFIG_ICONV - url_conv = iconv_open("UTF-16LE", "UTF-8"); + /* honor command line option first */ + if (!mp_url_charset) + mp_url_charset = getenv("MPLAYER_URL_CHARSET"); + + /* if not set, default is UTF-8 */ + if (!mp_url_charset) + mp_url_charset = "UTF-8"; + + url_conv = iconv_open("UTF-16LE", mp_url_charset); #endif snprintf (str, 1023, "\034\003NSPlayer/7.0.0.1956; {33715801-BAB3-9D85-24E9-03B90328270A}; Host: %s", url1->hostname); Index: DOCS/man/en/mplayer.1 =================================================================== --- DOCS/man/en/mplayer.1 (revision 29340) +++ DOCS/man/en/mplayer.1 (working copy) @@ -767,6 +767,10 @@ May be dangerous if playing from untrusted media. . .TP +.B \-urlcharset +Specify a charset for URL (default: UTF-8). +. +.TP .B "\-v\ \ \ \ \ " Increment verbosity level, one level for each \-v found on the command line. @@ -10797,6 +10801,10 @@ A value of "noconv" means no conversion. . .TP +.B MPLAYER_URL_CHARSET (also see \-urlcharset) +Charset for URL (default: UTF-8). +. +.TP .B MPLAYER_HOME Directory where MPlayer looks for user settings. . Index: cfg-common.h =================================================================== --- cfg-common.h (revision 29340) +++ cfg-common.h (working copy) @@ -10,6 +10,9 @@ extern int mp_msg_color; extern int mp_msg_module; +/* defined in stream/asf_mmst_streaming.c */ +extern char *mp_url_charset; + // codec/filter opts: (defined at libmpcodecs/vd.c) extern float screen_size_xy; extern float movie_aspect; Index: cfg-common-opts.h =================================================================== --- cfg-common-opts.h (revision 29340) +++ cfg-common-opts.h (working copy) @@ -17,6 +17,7 @@ {"nomsgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #ifdef CONFIG_ICONV {"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"urlcharset", &mp_url_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL}, #ifdef CONFIG_PRIORITY