findHTTPHeaderEncoding         package:RCurl         R Documentation

_F_i_n_d _t_h_e _e_n_c_o_d_i_n_g _o_f _t_h_e _H_T_T_P _r_e_s_p_o_n_s_e _f_r_o_m _t_h_e _H_T_T_P _h_e_a_d_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     findHTTPHeaderEncoding(str)

_A_r_g_u_m_e_n_t_s:

     str: one or more lines from the HTTP header

_V_a_l_u_e:

     'NA' or an integer value indicating the encoding to be used. This
     integer corresponds to the 'cetype_t'  enumeration in
     Rinternals.h.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     Writing R Extensions Manual and the section(s) on character
     encodings

_E_x_a_m_p_l_e_s:

     findHTTPHeaderEncoding("Content-Type: text/html;charset=ISO-8859-1\r\n")
     findHTTPHeaderEncoding("Content-Type: text/html; charset=utf-8\r\n")

