Include dependency graph for unicode.c:

Defines | |
| #define | lstat(a, b) stat(a, b) |
Functions | |
| static char * | locale_fast (const char *string, bool from) |
| static char * | locale_dup (const char *string, bool from) |
| void | LocaleFree (const char *str) |
| Releases (if needed) a localized or uniformized string. | |
| char * | FromLocale (const char *locale) |
| Converts a string from the system locale character encoding to UTF-8. | |
| char * | FromLocaleDup (const char *locale) |
| converts a string from the system locale character encoding to utf-8, the result is always allocated on the heap. | |
| char * | ToLocale (const char *utf8) |
| ToLocale: converts an UTF-8 string to local system encoding. | |
| char * | ToLocaleDup (const char *utf8) |
| converts a string from UTF-8 to the system locale character encoding, the result is always allocated on the heap. | |
| int | utf8_open (const char *filename, int flags, mode_t mode) |
| Opens a system file handle using UTF-8 paths. | |
| FILE * | utf8_fopen (const char *filename, const char *mode) |
| Opens a FILE pointer using UTF-8 filenames. | |
| int | utf8_mkdir (const char *dirname, mode_t mode) |
| Creates a directory using UTF-8 paths. | |
| DIR * | utf8_opendir (const char *dirname) |
| Opens a DIR pointer using UTF-8 paths. | |
| char * | utf8_readdir (DIR *dir) |
| Reads the next file name from an open directory. | |
| static int | dummy_select (const char *str) |
| int | utf8_loaddir (DIR *dir, char ***namelist, int(*select)(const char *), int(*compar)(const char **, const char **)) |
| Does the same as utf8_scandir(), but takes an open directory pointer instead of a directory path. | |
| int | utf8_scandir (const char *dirname, char ***namelist, int(*select)(const char *), int(*compar)(const char **, const char **)) |
| Selects file entries from a directory, as GNU C scandir(), yet using UTF-8 file names. | |
| static int | utf8_statEx (const char *filename, struct stat *buf, bool deref) |
| int | utf8_stat (const char *filename, struct stat *buf) |
| Finds file/inode informations, as stat(). | |
| int | utf8_lstat (const char *filename, struct stat *buf) |
| Finds file/inode informations, as lstat(). | |
| int | utf8_unlink (const char *filename) |
| Removes a file. | |
| static int | utf8_vasprintf (char **str, const char *fmt, va_list ap) |
| Formats an UTF-8 string as vasprintf(), then print it to stdout, with appropriate conversion to local encoding. | |
| 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 *stream, const char *fmt,...) |
| Formats an UTF-8 string as fprintf(), then print it, with appropriate conversion to local encoding. | |
| static char * | CheckUTF8 (char *str, char rep) |
| char * | EnsureUTF8 (char *str) |
| Replaces invalid/overlong UTF-8 sequences with question marks. | |
| const char * | IsUTF8 (const char *str) |
| Checks whether a string is a valid UTF-8 byte sequence. | |
| #define lstat | ( | a, | |||
| b | ) | stat(a, b) |
| static char* CheckUTF8 | ( | char * | str, | |
| char | rep | |||
| ) | [static] |
| static int dummy_select | ( | const char * | str | ) | [static] |
| 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.
| char* FromLocale | ( | const char * | locale | ) |
Converts a string from the system locale character encoding to UTF-8.
| locale | nul-terminated string to convert |
| char* FromLocaleDup | ( | const char * | locale | ) |
converts a string from the system locale character encoding to utf-8, the result is always allocated on the heap.
| locale | nul-terminated string to convert |
| const char* IsUTF8 | ( | const char * | str | ) |
Checks whether a string is a valid UTF-8 byte sequence.
| str | nul-terminated string to be checked |
| static char* locale_dup | ( | const char * | string, | |
| bool | from | |||
| ) | [inline, static] |
| static char* locale_fast | ( | const char * | string, | |
| bool | from | |||
| ) | [static] |
| void LocaleFree | ( | const char * | str | ) |
Releases (if needed) a localized or uniformized string.
| str | non-NULL return value from FromLocale() or ToLocale(). |
| char* ToLocale | ( | const char * | utf8 | ) |
ToLocale: converts an UTF-8 string to local system encoding.
| utf8 | nul-terminated string to be converted |
| char* ToLocaleDup | ( | const char * | utf8 | ) |
| FILE* utf8_fopen | ( | const char * | filename, | |
| const char * | mode | |||
| ) |
Opens a FILE pointer using UTF-8 filenames.
| filename | file path, using UTF-8 encoding | |
| mode | fopen file open mode |
| int utf8_fprintf | ( | FILE * | stream, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
Formats an UTF-8 string as fprintf(), then print it, with appropriate conversion to local encoding.
| int utf8_loaddir | ( | DIR * | dir, | |
| char *** | namelist, | |||
| int(*)(const char *) | select, | |||
| int(*)(const char **, const char **) | compar | |||
| ) |
Does the same as utf8_scandir(), but takes an open directory pointer instead of a directory path.
| int utf8_lstat | ( | const char * | filename, | |
| struct stat * | buf | |||
| ) |
Finds file/inode informations, as lstat().
Consider usign fstat() instead, if possible.
| filename | UTF-8 file path |
| int utf8_mkdir | ( | const char * | dirname, | |
| mode_t | mode | |||
| ) |
Creates a directory using UTF-8 paths.
| dirname | a UTF-8 string with the name of the directory that you want to create. | |
| mode | directory permissions |
| int utf8_open | ( | const char * | filename, | |
| int | flags, | |||
| mode_t | mode | |||
| ) |
Opens a system file handle using UTF-8 paths.
| filename | file path to open (with UTF-8 encoding) | |
| flags | open() flags, see the C library open() documentation | |
| mode | file permissions if creating a new file |
| DIR* utf8_opendir | ( | const char * | dirname | ) |
Opens a DIR pointer using UTF-8 paths.
| dirname | UTF-8 representation of the directory name |
| char* utf8_readdir | ( | DIR * | dir | ) |
Reads the next file name from an open directory.
| dir | The directory that is being read |
| int utf8_scandir | ( | const char * | dirname, | |
| char *** | namelist, | |||
| int(*)(const char *) | select, | |||
| int(*)(const char **, const char **) | compar | |||
| ) |
Selects file entries from a directory, as GNU C scandir(), yet using UTF-8 file names.
| dirname | UTF-8 diretory path | |
| pointer | [OUT] pointer set, on succesful completion, to the address of a table of UTF-8 filenames. All filenames must be freed with free(). The table itself must be freed with free() as well. |
| int utf8_stat | ( | const char * | filename, | |
| struct stat * | buf | |||
| ) |
Finds file/inode informations, as stat().
Consider usign fstat() instead, if possible.
| filename | UTF-8 file path |
| static int utf8_statEx | ( | const char * | filename, | |
| struct stat * | buf, | |||
| bool | deref | |||
| ) | [static] |
| int utf8_unlink | ( | const char * | filename | ) |
Removes a file.
| filename | a UTF-8 string with the name of the file you want to delete. |
| static int utf8_vasprintf | ( | char ** | str, | |
| const char * | fmt, | |||
| va_list | ap | |||
| ) | [static] |
Formats an UTF-8 string as vasprintf(), then print it to stdout, with appropriate conversion to local encoding.
| 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.
1.5.1