|
VLC
2.1.0-git
|
This files handles locale conversions in vlc. More...

Go to the source code of this file.
Macros | |
| #define | FromLocale(l) (l) |
| #define | ToLocale(u) (u) |
| #define | LocaleFree(s) ((void)(s)) |
| #define | FromLocaleDup strdup |
| #define | ToLocaleDup strdup |
Typedefs | |
| typedef void * | vlc_iconv_t |
Functions | |
| vlc_iconv_t | vlc_iconv_open (const char *, const char *) |
| size_t | vlc_iconv (vlc_iconv_t, const char **, size_t *, char **, size_t *) |
| int | vlc_iconv_close (vlc_iconv_t) |
| int | utf8_vfprintf (FILE *stream, const char *fmt, va_list ap) |
| Formats an UTF-8 string as vfprintf(), then print it, with appropriate conversion to local encoding. | |
| int | utf8_fprintf (FILE *, const char *,...) |
| Formats an UTF-8 string as fprintf(), then print it, with appropriate conversion to local encoding. | |
| char * | vlc_strcasestr (const char *, const char *) |
| Look for an UTF-8 string within another one in a case-insensitive fashion. | |
| char * | EnsureUTF8 (char *) |
| Replaces invalid/overlong UTF-8 sequences with question marks. | |
| const char * | IsUTF8 (const char *) |
| Checks whether a string is a valid UTF-8 byte sequence. | |
| char * | FromCharset (const char *charset, const void *data, size_t data_size) |
| Converts a string from the given character encoding to utf-8. | |
| void * | ToCharset (const char *charset, const char *in, size_t *outsize) |
| Converts a nul-terminated UTF-8 string to a given character encoding. | |
| static char * | FromLatin1 (const char *latin) |
| Converts a nul-terminated string from ISO-8859-1 to UTF-8. | |
| double | us_strtod (const char *, char **) |
| us_strtod() has the same prototype as ANSI C strtod() but it uses the POSIX/C decimal format, regardless of the current numeric locale. | |
| float | us_strtof (const char *, char **) |
| us_strtof() has the same prototype as ANSI C strtof() but it uses the POSIX/C decimal format, regardless of the current numeric locale. | |
| double | us_atof (const char *) |
| us_atof() has the same prototype as ANSI C atof() but it expects a dot as decimal separator, regardless of the system locale. | |
| int | us_vasprintf (char **, const char *, va_list) |
| us_vasprintf() has the same prototype as vasprintf(), but doesn't use the system locale. | |
| int | us_asprintf (char **, const char *,...) |
| us_asprintf() has the same prototype as asprintf(), but doesn't use the system locale. | |
This files handles locale conversions in vlc.
| #define FromLocale | ( | l | ) | (l) |
| #define FromLocaleDup strdup |
Referenced by config_GetLibDir(), config_LoadConfigFile(), and vlc_readdir().
| #define LocaleFree | ( | s | ) | ((void)(s)) |
Referenced by module_Load(), vlc_mkdir(), vlc_open(), vlc_opendir(), vlc_rename(), vlc_statEx(), and vlc_unlink().
| #define ToLocale | ( | u | ) | (u) |
Referenced by module_Load(), vlc_mkdir(), vlc_open(), vlc_opendir(), vlc_rename(), vlc_statEx(), and vlc_unlink().
| #define ToLocaleDup strdup |
Referenced by vlc_bindtextdomain(), and vlc_getcwd().
| typedef void* vlc_iconv_t |
| char* EnsureUTF8 | ( | char * | str | ) |
Replaces invalid/overlong UTF-8 sequences with question marks.
Note that it is not possible to convert from Latin-1 to UTF-8 on the fly, so we don't try that, even though it would be less disruptive.
References likely, and vlc_towc().
Referenced by filename_sanitize(), input_item_SetURI(), InputMetaUser(), and test().
| char* FromCharset | ( | const char * | charset, |
| const void * | data, | ||
| size_t | data_size | ||
| ) |
Converts a string from the given character encoding to utf-8.
References vlc_iconv(), vlc_iconv_close(), and vlc_iconv_open().
|
inlinestatic |
Converts a nul-terminated string from ISO-8859-1 to UTF-8.
| const char* IsUTF8 | ( | const char * | str | ) |
Checks whether a string is a valid UTF-8 byte sequence.
| str | nul-terminated string to be checked |
References likely, and vlc_towc().
Referenced by IsSDPString(), and test().
| void* ToCharset | ( | const char * | charset, |
| const char * | in, | ||
| size_t * | outsize | ||
| ) |
Converts a nul-terminated UTF-8 string to a given character encoding.
| charset | iconv name of the character set |
| in | nul-terminated UTF-8 string |
| outsize | pointer to hold the byte size of result |
References unlikely, vlc_iconv(), vlc_iconv_close(), and vlc_iconv_open().
| int us_asprintf | ( | char ** | , |
| const char * | , | ||
| ... | |||
| ) |
us_asprintf() has the same prototype as asprintf(), but doesn't use the system locale.
References us_vasprintf().
| double us_atof | ( | const char * | ) |
us_atof() has the same prototype as ANSI C atof() but it expects a dot as decimal separator, regardless of the system locale.
References us_strtod().
Referenced by config_ChainParse(), config_LoadCmdLine(), main(), var_Command(), var_InheritURational(), and var_OptionParse().
| double us_strtod | ( | const char * | , |
| char ** | |||
| ) |
us_strtod() has the same prototype as ANSI C strtod() but it uses the POSIX/C decimal format, regardless of the current numeric locale.
References freelocale(), LC_NUMERIC_MASK, newlocale(), and uselocale().
| float us_strtof | ( | const char * | , |
| char ** | |||
| ) |
us_strtof() has the same prototype as ANSI C strtof() but it uses the POSIX/C decimal format, regardless of the current numeric locale.
References freelocale(), LC_NUMERIC_MASK, newlocale(), strtof(), and uselocale().
| int us_vasprintf | ( | char ** | , |
| const char * | , | ||
| va_list | |||
| ) |
us_vasprintf() has the same prototype as vasprintf(), but doesn't use the system locale.
References freelocale(), LC_NUMERIC_MASK, newlocale(), uselocale(), and vasprintf().
Referenced by httpd_MsgAdd(), and us_asprintf().
| int utf8_fprintf | ( | FILE * | , |
| const char * | , | ||
| ... | |||
| ) |
Formats an UTF-8 string as fprintf(), then print it, with appropriate conversion to local encoding.
References utf8_vfprintf().
Referenced by Help(), libvlc_InternalInit(), ListModules(), print_help_on_full_help(), print_help_section(), PrintColorMsg(), PrintMsg(), Usage(), and Version().
| int utf8_vfprintf | ( | FILE * | stream, |
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Formats an UTF-8 string as vfprintf(), then print it, with appropriate conversion to local encoding.
References likely, unlikely, and vasprintf().
Referenced by PrintColorMsg(), PrintMsg(), and utf8_fprintf().
| size_t vlc_iconv | ( | vlc_iconv_t | , |
| const char ** | , | ||
| size_t * | , | ||
| char ** | , | ||
| size_t * | |||
| ) |
Referenced by FromCharset(), stream_ReadLine(), and ToCharset().
| int vlc_iconv_close | ( | vlc_iconv_t | ) |
Referenced by FromCharset(), stream_CommonDelete(), stream_ReadLine(), and ToCharset().
| vlc_iconv_t vlc_iconv_open | ( | const char * | , |
| const char * | |||
| ) |
Referenced by FromCharset(), stream_ReadLine(), and ToCharset().
| char* vlc_strcasestr | ( | const char * | haystack, |
| const char * | needle | ||
| ) |
Look for an UTF-8 string within another one in a case-insensitive fashion.
Beware that this is quite slow. Contrary to strcasestr(), this function works regardless of the system character encoding, and handles multibyte code points correctly.
| haystack | string to look into |
| needle | string to look for |
References unlikely, and vlc_towc().
Referenced by playlist_LiveSearchUpdateInternal(), and test_strcasestr().
1.8.1.2