| 1 |
\name{findHTTPHeaderEncoding} |
| 2 |
\alias{findHTTPHeaderEncoding} |
| 3 |
\title{Find the encoding of the HTTP response from the HTTP header} |
| 4 |
\description{ |
| 5 |
This function is currently made available so it can be called |
| 6 |
from C code to find the charset from the HTTP header in the |
| 7 |
response from an HTTP server. It maps this charset value |
| 8 |
to one of the known R encodings (UTF-8 or LATIN1) |
| 9 |
or returns the native encoding. |
| 10 |
|
| 11 |
This will most likely be removed in the future. |
| 12 |
} |
| 13 |
\usage{ |
| 14 |
findHTTPHeaderEncoding(str) |
| 15 |
} |
| 16 |
\arguments{ |
| 17 |
\item{str}{one or more lines from the HTTP header} |
| 18 |
} |
| 19 |
\value{ |
| 20 |
\code{NA} or an integer value indicating the encoding |
| 21 |
to be used. This integer corresponds to the \code{cetype_t} enumeration |
| 22 |
in Rinternals.h. |
| 23 |
} |
| 24 |
\references{Writing R Extensions Manual and the section(s) on character encodings} |
| 25 |
\author{Duncan Temple Lang} |
| 26 |
|
| 27 |
\examples{ |
| 28 |
findHTTPHeaderEncoding("Content-Type: text/html;charset=ISO-8859-1\r\n") |
| 29 |
findHTTPHeaderEncoding("Content-Type: text/html; charset=utf-8\r\n") |
| 30 |
} |
| 31 |
\keyword{IO} |
| 32 |
\keyword{programming} |
| 33 |
|