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

Rémi Denis-Courmont remi at remlab.net
Tue Aug 27 18:09:17 CEST 2013


Le mardi 27 août 2013 18:04:05 Edward Wang a écrit :
> On Tue, Aug 27, 2013 at 5:45 PM, Rémi Denis-Courmont <remi at remlab.net> 
wrote:
> > I only ever challenged the solution, not the problem.
> 
> As I understand it, you are simply opposed to exposing a new C
> function to perform this?

I am opposed to adding a special function that just calls two functions that 
already exist in Lua.

> It makes sense to do this in C, as every string in Lua should be UTF8.
> This would improve the architecture by sanitizing non-UTF8 strings
> from the Lua interface altogether.

Then from_charset() should be removed too. Oops.

> Other lua scripts in the future might have to demux non-UTF8 as well,
> and this function would be highly useful in those cases too.

And that is why we have from_charset() *already*. Plus from_charset() supports 
not only Latin-1, but any character set that LibVLC ships.
 
-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list