[vlc-devel] [PATCH 1/2] lua: add a guess_encoding function to convert Latin1 to UTF8
etix at videolan.org
Tue Aug 27 18:42:52 CEST 2013
On 08/27/2013 06:09 PM, Rémi Denis-Courmont wrote:
> 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>
>>> 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.
Why did you not say this in the first place? I don't get why it's so
hard to communicate with you…
>> 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.
Of course it would be better to not having to deal with encoding at all.
>> 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.
Deporting the complexity into the lua extensions is _not_ the best way
to promote them.
Then I'm sorry, I thought that Lua was meant to extend VLC easily
without having to care about low-level stuff.
More information about the vlc-devel