summaryrefslogtreecommitdiff
path: root/doc/posix-functions/wcsncpy.texi
blob: a9a555ee2fb8667bb7667246da7e6c60ad3b8b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@node wcsncpy
@section @code{wcsncpy}
@findex wcsncpy

POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/wcsncpy.html}

Gnulib module: wcsncpy

Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
IRIX 5.3, Solaris 2.5.1.
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore
cannot accommodate all Unicode characters.
@end itemize

Note: This function has no real use: It cannot be used for filling a fixed-size
record with a wide string, before writing it to a file, because the wide string
encoding is platform dependent and, on some platforms, also locale dependent.
And this function is @strong{not} appropriate for copying a wide string into a
bounded memory area, because you have no guarantee that the result will be
null-terminated. Even if you add the null character at the end yourself, this
function is inefficient (as it spends time clearing unused memory) and will
allow silent truncation to occur, which is not a good behavior for GNU programs.