[vlc-devel] [PATCH 1/2] lua: add a guess_encoding function to convert Latin1 to UTF8

Edward Wang edward.c.wang at compdigitec.com
Tue Aug 27 19:15:46 CEST 2013


On Tue, Aug 27, 2013 at 7:14 PM, Edward Wang
<edward.c.wang at compdigitec.com> wrote:
> On Tue, Aug 27, 2013 at 7:09 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
>> I really do not think that one call to a function that detects UTF-8 and falls
>> back to Latin-1
>
> IsUTF8 ( psz_input ) ? strdup ( psz_input ) : FromLatin1 ( psz_input );
>
> If input string is UTF8
> -> return said string [implies string is UTF8 by IF statement]
> else [implies string is NOT UTF8]
> -> return said string converted to UTF8
> IsUTF8 ( psz_input ) ?
>

Sorry, that last " IsUTF8 ( psz_input ) ?" was a paste error that does
not belong there.



More information about the vlc-devel mailing list