showNonASCII

0th

Percentile

Pick Out Non-ASCII Characters

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

Keywords
utilities
Usage
showNonASCII(x)

showNonASCIIfile(file)

Arguments
x
a character vector.
file
path to a file.
Details

This was originally written to help detect non-portable text in files in packages. It prints all element of x which contain non-ASCII characters, preceded by the element number and with non-ASCII bytes highlighted via iconv(sub = "byte").

Value

The elements of x containing non-ASCII characters will be returned invisibly.

Aliases
  • showNonASCII
  • showNonASCIIfile
Examples
library(tools) out <- c( "fa\xE7ile test of showNonASCII():", "\\details{", " This is a good line", " This has an \xfcmlaut in it.", " OK again.", "}") f <- tempfile() cat(out, file = f, sep = "\n") showNonASCIIfile(f) unlink(f)
Documentation reproduced from package tools, version 3.3.3, License: Part of R 3.3.3

Community examples

Looks like there are no examples yet.