[Ffmpeg-devel] retrieving asf textual info in other languages

?? c_liao
Tue May 17 10:41:55 CEST 2005

----- Original Message ----- 
From: "M?ns Rullg?rd" <mru at inprovide.com>
To: "FFMpeg development discussions and patches" <ffmpeg-devel at mplayerhq.hu>
Sent: Tuesday, May 17, 2005 4:12 PM
Subject: Re: [Ffmpeg-devel] retrieving asf textual info in other languages

Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
>> Hi guys:
>> What am I trying to do is to extract textual information from asf type
>> containers, namely the fields: title, author, copyright and comments. I'm
>> using libavformat to accomplish this. The problem I encountered is that 
>> the
>> extracted asf information within the AVFormatContext is corrupted. As I
>> know the textual information stored within asf containers should be in
>> unicode (UCS2), so I compiled a debug version of the libavformat and dug
>> deeper, this is what I found:


>> what I can see here is copying a 16 bit int (c) to a 8 bit char (*q), if
>> I'm not mistaken this would cut the higher 8 bit, this is fine for ascii
>> character which will just leave a lower ascii byte but will corrupt any
>> other language that also uses the higher byte. To confirm this I've also
>> tried some ffmpeg based player such as videoLan, and the result is the
>> same, no encoding other than ascii is shown in text fields. So this 
>> problem
>> definitly affects all asian languages.
>> So here are my questions: is this cutting of higher byte a deliberate act
>> to avoid EOS '\0' character ? or is this a bug ? and will you guys 
>> consider
>> a patch or fix soon for this ?
> send a patch, if its clean and working it will be considered
> note, the thing must be converted to utf8

> Is it acceptable to use iconv() for the conversion?

isn't libiconv GPL'ed ? so.. the simplest solution is just to treat it as a 
buffer and
let user handle it, however I haven't dived into other parts of the code so 
not sure
whether will cause any problems. or use iconv as default routine for 
and have a callback interface for user to define their own conversion 
routine if they
don't wish to use GPL'ed iconv.

yours sincerely

Cheng Liao

More information about the ffmpeg-devel mailing list