Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-20 Thread Thomas Zumbrunn
On Friday 20 January 2012, Simon Urbanek wrote: > On Jan 19, 2012, at 6:39 PM, Thomas Zumbrunn wrote: > > On Thursday 19 January 2012, peter dalgaard wrote: > >> On Jan 18, 2012, at 23:54 , Thomas Zumbrunn wrote: > >>> plain("Zürich") ## works > >>> plain("Z\u00BCrich") ## fails > >>> escaped(

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-19 Thread Simon Urbanek
On Jan 19, 2012, at 7:27 PM, Jeroen Ooms wrote: >> >> I installed "libiconv" from http://www.gnu.org/software/libiconv/, and >> now I can easily replace all non- ASCII characters in my UTF-8 encoded R >> files with: iconv -f UTF-8 -t ASCII --unicode-subst="\u%04X" >> my-utf-8-encoded-file.R > >

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-19 Thread Simon Urbanek
On Jan 19, 2012, at 6:39 PM, Thomas Zumbrunn wrote: > On Thursday 19 January 2012, peter dalgaard wrote: >> On Jan 18, 2012, at 23:54 , Thomas Zumbrunn wrote: >>> plain("Zürich") ## works >>> plain("Z\u00BCrich") ## fails >>> escaped("Zürich") ## fails >>> escaped("Z\u00BCrich") ## works

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-19 Thread Jeroen Ooms
> > I installed "libiconv" from http://www.gnu.org/software/libiconv/, and > now I can easily replace all non- ASCII characters in my UTF-8 encoded R > files with: iconv -f UTF-8 -t ASCII --unicode-subst="\u%04X" > my-utf-8-encoded-file.R Maybe it would be possible to create an R package that exp

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-19 Thread Thomas Zumbrunn
On Thursday 19 January 2012, peter dalgaard wrote: > On Jan 18, 2012, at 23:54 , Thomas Zumbrunn wrote: > > plain("Zürich") ## works > > plain("Z\u00BCrich") ## fails > > escaped("Zürich") ## fails > > escaped("Z\u00BCrich") ## works > > Using the correct UTF-8 code helps quite a bit:

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-18 Thread peter dalgaard
On Jan 18, 2012, at 23:54 , Thomas Zumbrunn wrote: > plain("Zürich") ## works > plain("Z\u00BCrich") ## fails > escaped("Zürich") ## fails > escaped("Z\u00BCrich") ## works Using the correct UTF-8 code helps quite a bit: U+00BC ¼ c2 bc VULGAR FRACTION ONE QUARTER U+00FC ü

[Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-18 Thread Thomas Zumbrunn
While preparing a function that contained non-ASCII characters for inclusion into a package, I replaced all non-ASCII characters with UTF-8 escape sequences (using \u) in order to make the package portable (and adhere to "R CMD check"). What I didn't expect: when one uses UTF-8 escape sequen