utf8Conversion             package:base             R Documentation

_C_o_n_v_e_r_t _t_o _o_r _f_r_o_m _U_T_F-_8-_e_n_c_o_d_e_d _C_h_a_r_a_c_t_e_r _V_e_c_t_o_r_s

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

     Conversion of UTF-8 encoded character vectors to and from integer
     vectors.

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

     utf8ToInt(x)
     intToUtf8(x, multiple = FALSE)

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

       x: object to be converted.

multiple: logical: should the conversion be to a single character
          string or multiple individual characters?

_D_e_t_a_i_l_s:

     These will work in any locale, including on machines that do not
     otherwise support multi-byte character sets.

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

     'utf8ToInt' converts a length-one character string encoded in
     UTF-8 to an integer vector of (numeric) UTF-8 code points.

     'intToUtf8' converts a vector of (numeric) UTF-8 code points
     either to a single character string or a character vector of
     single characters.  (For a single character string '0' is silently
     omitted: otherwise '0' is mapped to '""'.  Non-integral numeric
     values are truncated to integers.)  The 'Encoding' is declared as
     '"UTF-8"'.

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

     ## Not run: 
     ## will only display in some locales and fonts
     intToUtf8(0x03B2L) # Greek beta
     ## End(Not run)

