[vlc-devel] [PATCH 1/2] lua: add a guess_encoding function to convert Latin1 to UTF8
etix at videolan.org
Tue Aug 27 16:14:55 CEST 2013
On 08/27/2013 04:02 PM, Rémi Denis-Courmont wrote:
> On Tue, 27 Aug 2013 15:57:33 +0200, Ludovic Fauvet <etix at videolan.org>
>> On 08/27/2013 03:49 PM, Rémi Denis-Courmont wrote:
>>> On Tue, 27 Aug 2013 15:15:52 +0200, Ludovic Fauvet <etix at videolan.org>
>>>> modules/lua/libs/strings.c | 17 +++++++++++++++++
>>>> 1 file changed, 17 insertions(+)
>>> There is no point in doing this. from_charset already provides all
>>> needed (and is much sounder architecturally).
>> The from_charset function doesn't provide feedback nor failure if the
>> input string doesn't match the expected encoding
> That's not true. It returns an empty string on error, which is clearly
> different from success. Feel free to change it to return a proper error or
Sorry but you're wrong.
Using the following piece of code:
src = vlc.strings.from_charset("ISO_8859-1", src)
and the following UTF8 encoded input string:
Le Lac des Cygnes (Piotr Ilitch Tchaïkovsky)
It gives me the following result:
Le Lac des Cygnes (Piotr Ilitch TchaÃ¯kovsky)
Where's my empty string?
>> Or did I miss something?
More information about the vlc-devel