[MPlayer-dev-eng] a patch to show Chinese characters correctly in terminal

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Apr 4 11:17:10 CEST 2010


On Sun, Apr 04, 2010 at 02:30:07PM +0800, ideal wrote:
> Hi, this is a patch to show Chinese characters correctly in mplayer terminal
> mode, but some problems are still not solved.
> 
> Since many mp3, ogg files have GB* encoding (GB2312, GBK, GB18030) in id3
> tag info, but currently many GNU/Linux systems have a default LANGUAGE
> setting like zh_CN.UTF-8, thus caused that we get garbled music tag info
> when using mplayer to play songs in terminal.
> 
> Maybe we can use iconv() to convert tag encoding.

No you can't since you don't know and can't reliably find out the encoding.
Thus only UTF-8 is supported.
However, I don't mind if you add a generic function that applies whatever mangling
it wants to on anything that is _certain_ to be neither ASCII not UTF-8 and _very_
likely to not be latin-1, however if possible I don't think it should depend on the system's
locale setting, that is just unclean - a fallback-charset option or similar to MPlayer
would be more reasonable.
And disregard one part of the other reply: any and all uses of setlocale are and as
long as I can stop it will be banned from MPlayer, it is broken by design, particularly
if you want a chance to support multi-threading.



More information about the MPlayer-dev-eng mailing list