From Martin Maechler <maechler@stat.math.ethz.ch>  Mon May 12 14:25:18 1997
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Mon, 12 May 97 15:25:18 +0200
Subject: R-alpha: ISO-latin-1 characters in strings -- print.default & PARSE(?) problems
Message-ID: <9705121325.AA00438@>


There seems to be a problem in print.default with some
ISO-latin1 characters (the chars AFTER ASCII in western Europe...)
if they appear in strings. 
(no problem if they are part of a function comment, see below).

Some of the characters lead to 4 character Hex-codes being printed instead:
"" ## ^u    prints as "0xFB"

If you use the funny characters in comments of functions, they are stored
and printed properly.

HOWEVER: In a few rare cases, the strings are not even PARSED properly;
	the line 'ISOdiv <- ..' below gives a SYNTAX error.

The following code shows the symptoms :
   -- ONLY if  the e-mail between here and your place is  8-bit clean! --
  (else: get it ftp://ftp.stat.math.ethz.ch/U/maechler/R/string-test.R )

frenchquotes <- "..."  ## <<...>>
frenchquotes

Umlaute <- " " # = "a "o "u  "A "O "U
Umlaute #- only the last one is not printed properly...

A.accents <- " " # `a 'a ^a "a oa ae  `A 'A ^A "A oA AE
A.accents
EI.accents <- " "
EI.accents
O.accents <- ""
O.accents

U.accents <- ""
U.accents

ISO24x <-  " " #octal 241..257
ISO26x <- " " #octal 260..277

##--- THIS IS a Problem: It gives a SYNTAX error !
ISOdiv <- "    " 
##-- One of these characters even was producing the same as  'q()' !!

aa_ function(x) {
  x^2
  ##- frenchquotes <- "..."  ## <<...>>
  ##- Umlaute <- " " # = "a "o "u  "A "O "U
  ##- A.accents <- " " # `a 'a ^a "a oa ae  `A 'A ^A "A oA AE
  ##- EI.accents <- " "
  ##- O.accents <- ""
  ##- U.accents <- ""
  ##-
  ##- ISO24x <-  " " #octal 241..257
  ##- ISO26x <- " " #octal 260..277
  ##- ISOdiv <- " " ##-- OMITTED further: SYNTAX error !!
}
aa
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: ISO-latin-1 characters in strings -- print.default & PARSE(?) problems
Martin Maechler