[MPlayer-dev-eng] [PATCH] use system locale instead of C locale

KO Myung-Hun komh at chollian.net
Tue May 19 16:20:02 CEST 2009


Hi/2.

KO Myung-Hun wrote:
> Hi/2.
>
> Diego Biurrun wrote:
>> On Sun, May 17, 2009 at 03:41:43PM +0900, KO Myung-Hun wrote:
>>  
>>> This patch makes MPlayer use system locale instead of C locale on OS/2.
>>>     
>>
>> Why?
>>
>>   
>
> 1. OS/2 implementation of iconv() converts an absent character such as 
> copyright symbol to 0x1a which means 'substitute character'. BTW when 
> piping of the output of MPlayer to other program, 0x1a means Ctrl-Z, 
> i.e. EOF. So SIGPIPE occur.
>

I've fixed by allocating buffer for 'charset'. OS/2 implementation of 
nl_langinfo( CODESET ) returns the static variable. So even though if we 
got 'charset' by setting locale to system one, it is changed to new one 
after setting locale to C. But we should accept memory-leak. Fine ?

> 2.  stream/asf_mmst_streaming.c uses nl_langinfo(CODESET) to select 
> 'from code' of iconv_open(). But if C locale is used, national 
> characters such as DBCS are not converted correctly to UTF-16LE.
>

And I wrapped setlocale() around nl_langinfo()  to use system locale. 
This enables to use URL consisted of national characters.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.16
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: getch2-os2.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090519/59edb5dc/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: asf_mmst_streaming.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090519/59edb5dc/attachment.asc>


More information about the MPlayer-dev-eng mailing list