localeToCharset            package:utils            R Documentation

_S_e_l_e_c_t _a _S_u_i_t_a_b_l_e _E_n_c_o_d_i_n_g _N_a_m_e _f_r_o_m _a _L_o_c_a_l_e _N_a_m_e

_D_e_s_c_r_i_p_t_i_o_n:

     This functions aims to find a suitable coding for the locale
     named, by default the current locale, and if it is a UTF-8 locale
     a suitable single-byte encoding.

_U_s_a_g_e:

     localeToCharset(locale = Sys.getlocale("LC_CTYPE"))

_A_r_g_u_m_e_n_t_s:

  locale: character string naming a locale.

_D_e_t_a_i_l_s:

     The operation differs by OS. Locale names are normaly like
     'es_MX.iso88591'.  If final component indicates an encoding and it
     is not 'utf8' we just need to look up the equivalent encoding
     name.  Otherwise, the language (here 'es') is used to choose a
     primary or fallback encoding.

     In the 'C' locale the answer will be '"ASCII"'.

_V_a_l_u_e:

     A character vector naming an encoding and possibly a fallback
     single-encoding,  'NA' if unknown.

_N_o_t_e:

     The encoding names are those used by 'libiconv', and ought also to
     work with 'glibc' but maybe not with commercial Unixen.

_S_e_e _A_l_s_o:

     'Sys.getlocale', 'iconv'.

_E_x_a_m_p_l_e_s:

     localeToCharset()

