27 #ifndef _HAVE_FL_UTF8_HDR_
28 #define _HAVE_FL_UTF8_HDR_
30 #include "Fl_Export.H"
63 FL_EXPORT
unsigned fl_utf8decode(
const char* p,
const char* end,
int* len);
69 FL_EXPORT
const char*
fl_utf8fwd(
const char* p,
const char* start,
const char* end);
72 FL_EXPORT
const char*
fl_utf8back(
const char* p,
const char* start,
const char* end);
75 FL_EXPORT
unsigned fl_ucs_to_Utf16(
const unsigned ucs,
unsigned short *dst,
const unsigned dstlen);
78 FL_EXPORT
unsigned fl_utf8toUtf16(
const char* src,
unsigned srclen,
unsigned short* dst,
unsigned dstlen);
81 FL_EXPORT
unsigned fl_utf8towc(
const char *src,
unsigned srclen,
wchar_t *dst,
unsigned dstlen);
84 FL_EXPORT
unsigned fl_utf8fromwc(
char *dst,
unsigned dstlen,
const wchar_t *src,
unsigned srclen);
87 FL_EXPORT
unsigned fl_utf8toa (
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
90 FL_EXPORT
unsigned fl_utf8froma (
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
98 FL_EXPORT
int fl_utf8test(
const char *src,
unsigned len);
113 FL_EXPORT
unsigned fl_utf8to_mb(
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
118 FL_EXPORT
unsigned fl_utf8from_mb(
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
124 FL_EXPORT
char *fl_utf8_to_locale(
const char *s,
int len,
unsigned int codepage);
127 FL_EXPORT
char *fl_locale_to_utf8(
const char *s,
int len,
unsigned int codepage);
148 FL_EXPORT
int fl_utf_tolower(
const unsigned char *str,
int len,
char *buf);
151 FL_EXPORT
int fl_utf_toupper(
const unsigned char *str,
int len,
char *buf);
154 FL_EXPORT
int fl_chmod(
const char* f,
int mode);
157 FL_EXPORT
int fl_access(
const char* f,
int mode);
160 FL_EXPORT
int fl_stat(
const char *path,
struct stat *buffer);
163 FL_EXPORT
char *
fl_getcwd(
char *buf,
int len);
166 FL_EXPORT
int fl_chdir(
const char *path);
169 FL_EXPORT FILE *
fl_fopen(
const char *f,
const char *mode);
175 FL_EXPORT
int fl_execvp(
const char *file,
char *
const *argv);
178 FL_EXPORT
int fl_open(
const char *fname,
int oflags, ...);
180 FL_EXPORT
int fl_open_ext(
const char *fname,
int binary,
int oflags, ...);
186 FL_EXPORT
int fl_unlink(
const char *fname);
189 FL_EXPORT
int fl_rmdir(
const char *f);
192 FL_EXPORT
char*
fl_getenv(
const char *name);
195 FL_EXPORT
int fl_putenv(
const char *var);
198 FL_EXPORT
int fl_mkdir(
const char* f,
int mode);
201 FL_EXPORT
int fl_rename(
const char* f,
const char *t);
This file contains simple "C"-style type definitions.
FL_EXPORT char * fl_getenv(const char *name)
Cross-platform function to get environment variables with a UTF-8 encoded name or value.
Definition: fl_utf8.cxx:311
FL_EXPORT int fl_open(const char *fname, int oflags,...)
Cross-platform function to open files with a UTF-8 encoded name.
Definition: fl_utf8.cxx:359
FL_EXPORT unsigned fl_utf8toa(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Convert a UTF-8 sequence into an array of 1-byte characters.
Definition: fl_utf8.cxx:1056
FL_EXPORT int fl_chmod(const char *f, int mode)
Cross-platform function to set a files mode() with a UTF-8 encoded name or value.
Definition: fl_utf8.cxx:445
FL_EXPORT int fl_utf_strncasecmp(const char *s1, const char *s2, int n)
UTF-8 aware strncasecmp - converts to lower case Unicode and tests.
Definition: fl_utf8.cxx:151
FL_EXPORT int fl_utf8bytes(unsigned ucs)
Return the number of bytes needed to encode the given UCS4 character in UTF-8.
Definition: fl_utf8.cxx:845
FL_EXPORT int fl_utf8len(char c)
Returns the byte length of the UTF-8 sequence with first byte c, or -1 if c is not valid.
Definition: fl_utf8.cxx:69
FL_EXPORT int fl_wcwidth(const char *src)
extended wrapper around fl_wcwidth_(unsigned int ucs) function.
Definition: fl_utf8.cxx:1217
FL_EXPORT int fl_utf_toupper(const unsigned char *str, int len, char *buf)
Converts the string str to its upper case equivalent into buf.
Definition: fl_utf8.cxx:233
FL_EXPORT unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen)
Turn "wide characters" as returned by some system calls (especially on Windows) into UTF-8.
Definition: fl_utf8.cxx:1289
FL_EXPORT int fl_chdir(const char *path)
Cross-platform function to change the current working directory, given as a UTF-8 encoded string.
Definition: fl_utf8.cxx:508
FL_EXPORT int fl_system(const char *f)
Cross-platform function to run a system command with a UTF-8 encoded string.
Definition: fl_utf8.cxx:425
FL_EXPORT int fl_stat(const char *path, struct stat *buffer)
Cross-platform function to stat() a file using a UTF-8 encoded name or value.
Definition: fl_utf8.cxx:479
FL_EXPORT unsigned fl_utf8toUtf16(const char *src, unsigned srclen, unsigned short *dst, unsigned dstlen)
Convert a UTF-8 sequence into an array of 16-bit characters.
Definition: fl_utf8.cxx:998
FL_EXPORT int fl_close_fd(int fd)
Cross-platform function to close a file descriptor.
Definition: fl_utf8.cxx:372
FL_EXPORT int fl_rename(const char *f, const char *t)
Cross-platform function to rename a filesystem object using UTF-8 encoded names.
Definition: fl_utf8.cxx:584
FL_EXPORT unsigned fl_utf8to_mb(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Convert the UTF-8 used by FLTK to the locale-specific encoding used for filenames (and sometimes used...
Definition: fl_utf8.cxx:1328
FL_EXPORT int fl_tolower(unsigned int ucs)
Returns the Unicode lower case value of ucs.
Definition: fl_utf8.cxx:187
FL_EXPORT int fl_putenv(const char *var)
Cross-platform function to write environment variables with a UTF-8 encoded name or value.
Definition: fl_utf8.cxx:343
FL_EXPORT unsigned int fl_nonspacing(unsigned int ucs)
Returns true if the Unicode character ucs is non-spacing.
Definition: fl_utf8.cxx:271
FL_EXPORT int fl_mkdir(const char *f, int mode)
Cross-platform function to create a directory with a UTF-8 encoded name.
Definition: fl_utf8.cxx:557
FL_EXPORT int fl_access(const char *f, int mode)
Cross-platform function to test a files access() with a UTF-8 encoded name or value.
Definition: fl_utf8.cxx:465
FL_EXPORT int fl_wcwidth_(unsigned int ucs)
Wrapper to adapt Markus Kuhn's implementation of wcwidth() for FLTK.
Definition: fl_utf8.cxx:1200
FL_EXPORT const char * fl_utf8fwd(const char *p, const char *start, const char *end)
Move p forward until it points to the start of a UTF-8 character.
Definition: fl_utf8.cxx:794
FL_EXPORT char * fl_getcwd(char *buf, int len)
Cross-platform function to get the current working directory as a UTF-8 encoded value.
Definition: fl_utf8.cxx:528
FL_EXPORT FILE * fl_fopen(const char *f, const char *mode)
Cross-platform function to open files with a UTF-8 encoded name.
Definition: fl_utf8.cxx:410
FL_EXPORT char * fl_utf2mbcs(const char *src)
Converts UTF-8 string s to a local multi-byte character string.
Definition: fl_utf8.cxx:280
FL_EXPORT char fl_make_path(const char *path)
Cross-platform function to recursively create a path in the file system.
Definition: fl_utf8.cxx:596
FL_EXPORT int fl_unlink(const char *fname)
Cross-platform function to unlink() (that is, delete) a file using a UTF-8 encoded filename.
Definition: fl_utf8.cxx:544
FL_EXPORT int fl_open_ext(const char *fname, int binary, int oflags,...)
Cross-platform function to open files with a UTF-8 encoded name.
Definition: fl_utf8.cxx:391
FL_EXPORT int fl_toupper(unsigned int ucs)
Returns the Unicode upper case value of ucs.
Definition: fl_utf8.cxx:195
FL_EXPORT unsigned fl_utf8towc(const char *src, unsigned srclen, wchar_t *dst, unsigned dstlen)
Converts a UTF-8 string into a wide character string.
Definition: fl_utf8.cxx:1255
FL_EXPORT int fl_utf_tolower(const unsigned char *str, int len, char *buf)
Converts the string str to its lower case equivalent into buf.
Definition: fl_utf8.cxx:204
FL_EXPORT int fl_utf8locale(void)
Return true if the "locale" seems to indicate that UTF-8 encoding is used.
Definition: fl_utf8.cxx:1307
FL_EXPORT int fl_rmdir(const char *f)
Cross-platform function to remove a directory with a UTF-8 encoded name.
Definition: fl_utf8.cxx:570
FL_EXPORT const char * fl_utf8back(const char *p, const char *start, const char *end)
Move p backward until it points to the start of a UTF-8 character.
Definition: fl_utf8.cxx:825
FL_EXPORT int fl_utf_strcasecmp(const char *s1, const char *s2)
UTF-8 aware strcasecmp - converts to Unicode and tests.
Definition: fl_utf8.cxx:179
FL_EXPORT unsigned fl_utf8decode(const char *p, const char *end, int *len)
Decode a single UTF-8 encoded character starting at p.
Definition: fl_utf8.cxx:702
FL_EXPORT unsigned fl_ucs_to_Utf16(const unsigned ucs, unsigned short *dst, const unsigned dstlen)
Convert a single 32-bit Unicode codepoint into an array of 16-bit characters.
Definition: fl_utf8.cxx:929
FL_EXPORT unsigned fl_utf8from_mb(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Convert a filename from the locale-specific multibyte encoding used by Windows to UTF-8 as used by FL...
Definition: fl_utf8.cxx:1360
FL_EXPORT int fl_utf8encode(unsigned ucs, char *buf)
Write the UTF-8 encoding of ucs into buf and return the number of bytes written.
Definition: fl_utf8.cxx:875
FL_EXPORT unsigned fl_utf8froma(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Convert an ISO-8859-1 (ie normal c-string) byte stream to UTF-8.
Definition: fl_utf8.cxx:1111
FL_EXPORT void fl_make_path_for_file(const char *path)
Cross-platform function to create a path for the file in the file system.
Definition: fl_utf8.cxx:616
FL_EXPORT int fl_utf8len1(char c)
Returns the byte length of the UTF-8 sequence with first byte c, or 1 if c is not valid.
Definition: fl_utf8.cxx:99
FL_EXPORT int fl_utf8test(const char *src, unsigned len)
Examines the first srclen bytes in src and returns a verdict on whether it is UTF-8 or not.
Definition: fl_utf8.cxx:1162
FL_EXPORT int fl_utf_nb_char(const unsigned char *buf, int len)
Returns the number of Unicode chars in the UTF-8 string.
Definition: fl_utf8.cxx:125