[FFmpeg-devel] [PATCH] avutil/log: in colored_fputs, convert string from utf8 to CP_ACP charset on Windows

Anshul anshul.ffmpeg at gmail.com
Thu Feb 20 18:13:13 CET 2014

Derek Buitenhuis <derek.buitenhuis at gmail.com> wrote:
>On 2/20/2014 4:33 PM, Anshul wrote:
>> I do write callback for avlog in such conditions, but it would be
>good if someone make an option that only use ascii, it would be better
>if there would be function like avset_log_ch_fmt().
>> It would also benifit when we redirect log in text file. In text file
>all the character that are used for color look like garbage.
>Currently, as it stands, colors are not written when redirected to a
>file in any sane environment.

I was not talking about any terminal or cmd prompt but when we use 
Redirection in our core code like changing stdout fd  to some file fd

>I am with Jan on this one. It is a *bad* idea. We shouldn't hack around
>legacy crap (that will never change btw, according to MS) by mucking
>with the encoding
>like this. It violates the principle of least astonishment[1] --
>everyone expects output
>to be unicode, including our own FATE scripts. Also, this would
>probably break output
>in the MSYS terminal, which handles unicode fine.
>More over, even for what this patch wants to do, it does it wrong. The

>correct way can
>would be to use _setmode() with _O_U8TEXT

+1 I agree
And would like more info(pointer to code )about it if possible.

>(MS move his blog so I can't find the current page.)
>- Derek
>[1] http://en.wikipedia.org/wiki/Principle_of_least_astonishment

+1 agree but if there is an option specified by user than it wont be surprising, it would be grt to have both sollution.

>ffmpeg-devel mailing list
>ffmpeg-devel at ffmpeg.org

Sent from my Android device with K-9 Mail. Please excuse my brevity.

More information about the ffmpeg-devel mailing list