]> git.lizzy.rs Git - plan9front.git/blob - sys/man/2/idn
tmparse: put in local timezone hack
[plan9front.git] / sys / man / 2 / idn
1 .TH IDN 2
2 .SH NAME
3 utf2idn, idn2utf \- convert internationalized domain names to and from unicode
4 .SH SYNOPSIS
5 .B #include <u.h>
6 .br
7 .B #include <libc.h>
8 .PP
9 .B
10 int     utf2idn(char *name, char *buf, int nbuf);
11 .PP
12 .B
13 int     idn2utf(char *name, char *buf, int nbuf);
14 .SH DESCRIPTION
15 These routines handle encoding and decoding of domain
16 names as specified by RFC5890.
17 .PP
18 .I Utf2idn
19 encodes the
20 .SM UTF
21 string
22 .I name
23 to
24 .SM ASCII
25 internatlionalized domain name in
26 .IR buf .
27 .I Idn2utf
28 does the reverse, decoding the
29 .SM ASCII
30 string
31 .I name
32 back to
33 .SM UTF
34 in
35 .IR buf .
36 The maximum size of
37 .I buf
38 is gived by
39 .IR nbuf .
40 .SH SOURCE
41 .B /sys/src/libc/9sys/idn.c
42 .SH "SEE ALSO"
43 .B /lib/rfc/rfc5890
44 .br
45 .IR utf (6)
46 .SH DIAGNOSTICS
47 The return value is the number of bytes (excluding the terminating NULL) in
48 .I buf
49 or
50 .B -1
51 on failure.