[vlc-devel] [PATCH] Return null when vlc.strings.from_charset charset is invalid

Edward Wang edward.c.wang at compdigitec.com
Mon Jan 9 12:57:06 CET 2012


On 12-01-09 03:24 AM, Rémi Denis-Courmont wrote:
> You seem to assume that FromCharset() returns NULL only on iconv_open()
> failure. That is not true.
Documentation from /src/text/unicode.c:395
/**
  * Converts a string from the given character encoding to utf-8.
  *
  * @return a nul-terminated utf-8 string, or null in case of error.
  * The result must be freed using free().
  */
char *FromCharset(const char *charset, const void *data, size_t data_size)

It says it will return NULL in case of error (I emphasize "null in case 
of error"), right? Otherwise I'm afraid not too sure I'm getting at what 
you're saying here.

Or are you saying the debug message should be "invalid charset or failed 
conversion", since there is no way to differentiate?

Thanks,
     Edward Wang



More information about the vlc-devel mailing list