showNonASCII              package:tools              R Documentation

_H_i_g_h_l_i_g_h_t _n_o_n-_A_S_C_I_I _c_h_a_r_a_c_t_e_r_s

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

     This function prints elements of a character vector which contain
     non-ASCII bytes, printing such bytes as a escape like '<fc>'.

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

     showNonASCII(x)

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

       x: a character vector.

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

     This was originally written to help detect non-portable text in
     files in packages.

     It prints all lines of the files which contain non-ACII
     characters, preceded by the line number and with non-ASCII bytes
     highlighted _via_ 'iconv(sub = "byte")'.

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

     out <- c(
     "fa\xE7ile test of showNonASCII():",
     "\\details{",
     "   This is a good line",
     "   This has an \xfcmlaut in it.",
     "   OK again.",
     "}")
     cat(out, file = "my.Rd", sep = "\n")

     showNonASCII(readLines("my.Rd"))
     unlink("my.Rd")

