File: findHTTPHeaderEncoding.Rd

package info (click to toggle)
r-cran-rcurl 1.95-4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,140 kB
  • ctags: 515
  • sloc: ansic: 3,135; xml: 1,734; asm: 993; sh: 12; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download | duplicates (6)
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
\name{findHTTPHeaderEncoding}
\alias{findHTTPHeaderEncoding}
\title{Find the encoding of the HTTP response from the HTTP header}
\description{
  This function is currently made available so it can be called
  from C code to find the charset from the HTTP header in the
  response from an HTTP server. It maps this charset value
  to one of the known R encodings (UTF-8 or LATIN1)
  or returns the native encoding.

  This will most likely be removed in the future.
}
\usage{
findHTTPHeaderEncoding(str)
}
\arguments{
  \item{str}{one or more lines from the HTTP header}
}
\value{
  \code{NA} or an integer value indicating the encoding
  to be used. This integer corresponds to the \code{cetype_t}  enumeration
  in Rinternals.h.
}
\references{Writing R Extensions Manual and the section(s) on character encodings}
\author{Duncan Temple Lang}

\examples{
findHTTPHeaderEncoding("Content-Type: text/html;charset=ISO-8859-1\r\n")
findHTTPHeaderEncoding("Content-Type: text/html; charset=utf-8\r\n")
}
\keyword{IO}
\keyword{programming}