1WSTR_TO_ASCII(3)             http://www.synce.org/            WSTR_TO_ASCII(3)
2
3
4

NAME

6       wstr_to_ascii - wide string handling functions
7

SYNOPSIS

9       #include <synce.h>
10
11       char *wstr_to_ascii(LPCWSTR unicode);
12       char *wstr_to_utf8(LPCWSTR unicode);
13       char *wstr_to_current(LPCWSTR unicode);
14
15       LPWSTR wstr_from_ascii(const char * ascii);
16       LPWSTR wstr_from_utf8(const char * utf8);
17       LPWSTR wstr_from_current(const char * utf8);
18
19       void wstr_free_string(void * string);
20
21       size_t wstrlen(LPCWSTR unicode);
22
23       LPWSTR wstrcpy(LPWSTR dest, LPCWSTR src);
24
25       bool wstr_append(LPWSTR dest, LPCWSTR src, size_t max_dest_length);
26
27       bool wstr_equal(LPWSTR a, LPWSTR b);
28
29       LPWSTR wstrdup(LPCWSTR string);
30
31

DESCRIPTION

33       The wstr_to_xxx() functions convert a wide char string to the appropriā€
34       ate local string. The wstr_from_xxx() functions  do  the  reverse.  Use
35       wstr_free_string() to free memory allocated for wide strings.
36
37       wstrcpy() requires that dest is large enough to contain src.  No bounds
38       checking is performed.
39
40       wstr_append() requires that dest is at least max_dest_length  long.  No
41       bounds checking is performed.
42
43       The remaining functions perform standard string operations on wide char
44       strings.
45
46

RETURN VALUE

48       wstr_to_xxx() and wstr_from_xxx()  return  pointers  to  the  allocated
49       strings,  or  NULL  on  failure, which will occur if a source character
50       cannot be represented in the destination encoding.
51
52       wstrdup() return a pointer to the allocated string, or NULL on failure.
53       wstrlen()  returns the string length.  wstrcpy() returns the pointer to
54       src.
55
56       wstr_append() returns false on failure eg. if the sum of the lengths is
57       greater than max_dest_length, true on success.
58
59       wstr_equal() returns true if a and b are equal, false otherwise.
60

SEE ALSO

62       synce(7)
63
64
65
66The SynCE Project                 2007-08-26                  WSTR_TO_ASCII(3)
Impressum