# NOT RUN {
chars8bit(65:70)#-> "A" "B" .. "F"
stopifnot(identical(LETTERS, chars8bit(65:90)),
identical(AsciiToInt(LETTERS), 65:90))
# }
# NOT RUN {
<!-- % In R 2.1.0, the "<U+22823BF5>ld not even be parsed in UTF-8; now gives NA -->
# }
# NOT RUN {
## may only work in ISO-latin1 locale (not in UTF-8):
try( strcodes(c(a= "ABC", ch="1234", place = "Z<U+32A63A22>)) )
## in "latin-1" gives {otherwise should give NA instead of 252}:
\dontrun{
$a
[1] 65 66 67
$ch
[1] 49 50 51 52
$place
[1] 90 252 114 105 99 104
}
myloc <- Sys.getlocale()
if(.Platform $ OS.type == "unix") withAutoprint({ # ''should work'' here
try( Sys.setlocale(locale = "de_CH") )# "try": just in case
strcodes(c(a= "ABC", ch="1234", place = "Z<U+32A63A22>)) # no NA hopefully
AsciiToInt(chars8bit()) # -> 1:255 {if setting latin1 succeeded above}
chars8bit(97:140)
try( Sys.setlocale(locale = "de_CH.utf-8") )# "try": just in case
chars8bit(97:140) ## typically looks different than above
# }
Run the code above in your browser using DataLab