File: puny.Rd

package info (click to toggle)
r-cran-urltools 1.7.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 512 kB
  • sloc: cpp: 1,234; ansic: 303; sh: 13; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{puny_encode}
\alias{puny_encode}
\alias{puny_decode}
\title{Encode or Decode Internationalised Domains}
\usage{
puny_encode(x)

puny_decode(x)
}
\arguments{
\item{x}{a vector of URLs. These should be URL decoded using \code{\link{url_decode}}.}
}
\value{
a CharacterVector containing encoded or decoded versions of the entries in \code{x}.
Invalid URLs (ones that are \code{NA}, or ones that do not successfully map to an actual
decoded or encoded version) will be returned as \code{NA}.
}
\description{
\code{puny_encode} and \code{puny_decode} implement
the encoding standard for internationalised (non-ASCII) domains and
subdomains. You can use them to encode UTF-8 domain names, or decode
encoded names (which start "xn--"), or both.
}
\examples{
# Encode a URL
puny_encode("https://www.bücher.com/foo")

# Decode the result, back to the original
puny_decode("https://www.xn--bcher-kva.com/foo")

}
\seealso{
\code{\link{url_decode}} and \code{\link{url_encode}} for percent-encoding.
}