Changeset ef3cb2648951426660cfa50a6c8f23c0d48a6839

Show
Ignore:
Timestamp:
23/03/07 20:28:48 (2 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1174678128 +0000
git-parent:

[830641e412aa599f0d1568b738214aa9752ade7b]

git-author:
Laurent Aimar <fenrir@videolan.org> 1174678128 +0000
Message:

Fixed #949 (UTF-8 url support)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/mms/buffer.c

    r2cb472d ref3cb26  
    125125    else 
    126126    { 
    127         for( i = 0; i < strlen( p_str ) + 1; i++ ) // and 0 
     127        vlc_iconv_t iconv_handle; 
     128        size_t i_in = strlen( p_str ); 
     129        size_t i_out = i_in * 4; 
     130        char *psz_out, *psz_tmp; 
     131        uint16_t *pw; 
     132 
     133        psz_out = psz_tmp = malloc( i_out + 1 ); 
     134        iconv_handle = vlc_iconv_open( "UTF-16LE", "UTF-8" ); 
     135        vlc_iconv( iconv_handle, &p_str, &i_in, &psz_tmp, &i_out ); 
     136        vlc_iconv_close( iconv_handle ); 
     137        psz_tmp[0] = '\0'; 
     138        psz_tmp[1] = '\0'; 
     139 
     140        for( i = 0; ; i += 2 ) 
    128141        { 
    129             var_buffer_add16( p_buf, p_str[i] ); 
     142            uint16_t v = GetWLE( &psz_out[i] ); 
     143            var_buffer_add16( p_buf, v ); 
     144            if( !v ) 
     145                break; 
    130146        } 
     147        free( psz_out ); 
    131148    } 
    132149} 
  • modules/access/mms/mmstu.c

    ra1d0725 ref3cb26  
    12191219    if( i_packet_seq_num != p_sys->i_packet_seq_num ) 
    12201220    { 
     1221#if 0 
    12211222        /* FIXME for udp could be just wrong order ? */ 
    12221223        msg_Warn( p_access, 
     
    12241225                  i_packet_seq_num, 
    12251226                  p_sys->i_packet_seq_num ); 
    1226         p_sys->i_packet_seq_num = i_packet_seq_num; 
    1227     } 
    1228     p_sys->i_packet_seq_num++
     1227#endif 
     1228    } 
     1229    p_sys->i_packet_seq_num = i_packet_seq_num + 1
    12291230 
    12301231    if( i_packet_id == p_sys->i_header_packet_id_type )