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()

