diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-09-26 15:58:19 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-09-26 15:58:19 +0200 |
commit | e7f777ae03a4e739471c8916b436fd261da242fa (patch) | |
tree | f739bc794de291b8b2691b2c55b043e51a62c15d | |
parent | a600610fded8cd7b5a2b24787d10b2fdaea50d7e (diff) |
idn(2): add documentation for idn2utf() and utf2idn()
-rw-r--r-- | sys/man/2/idn | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sys/man/2/idn b/sys/man/2/idn new file mode 100644 index 000000000..98958f832 --- /dev/null +++ b/sys/man/2/idn @@ -0,0 +1,51 @@ +.TH IDN 2 +.SH NAME +utf2idn, idn2utf \- convert internationalized domain names to and from unicode +.SH SYNOPSIS +.B #include <u.h> +.br +.B #include <libc.h> +.PP +.B +int utf2idn(char *name, char *buf, int nbuf); +.PP +.B +int idn2utf(char *name, char *buf, int nbuf); +.SH DESCRIPTION +These routines handle encoding and decoding of domain +names as specified by RFC5890. +.PP +.I Utf2idn +encodes the +.SM UTF +string +.I name +to +.SM ASCII +internatlionalized domain name in +.IR buf . +.I Idn2utf +does the reverse, decoding the +.SM ASCII +string +.I name +back to +.SM UTF +in +.IR buf . +The maximum size of +.I buf +is gived by +.IR nbuf . +.SH DIAGNOSTICS +The return value is the number of bytes (excluding the terminating NULL) in +.I buf +or +.B -1 +on failure. +.SH SOURCE +.B /sys/src/libc/9sys/idn.c +.SH "SEE ALSO" +.B /lib/rfc/rfc5890 +.br +.IR utf (6) |