Re: [Rd] Windows, format.POSIXct and character encodings

2013-05-02 Thread Hadley Wickham
>> identical(x, y) >> # [1] TRUE >> >> # But, confusingly, ... >> >> charToRaw(x) >> # [1] e5 8d 88 e5 89 8d 2b 2a e5 8d 88 e5 be 8c >> >> charToRaw(y) >> # [1] 8c df 91 4f 2b 2a 8c df 8c e3 >> > > That's not confusing at all: > >> Encoding(x) > [1] "UTF-8" >> Encoding(y) > [1] "unknown" > > The fi

Re: [Rd] Windows, format.POSIXct and character encodings

2013-05-01 Thread Simon Urbanek
On May 1, 2013, at 5:33 PM, Simon Urbanek wrote: > > On May 1, 2013, at 10:06 AM, Hadley Wickham wrote: > >> Hi all, >> >> In what encoding does format.POSIXct return its output? It doesn't >> seem to be utf-8: >> >> Sys.setlocale("LC_ALL", "Japanese_Japan.932") >> >> times <- c("1970-01-01

Re: [Rd] Windows, format.POSIXct and character encodings

2013-05-01 Thread Simon Urbanek
On May 1, 2013, at 10:06 AM, Hadley Wickham wrote: > Hi all, > > In what encoding does format.POSIXct return its output? It doesn't > seem to be utf-8: > > Sys.setlocale("LC_ALL", "Japanese_Japan.932") > > times <- c("1970-01-01 01:00:00 UTC", "1970-02-02 22:00:00 UTC") > ampm <- format(as.POS

[Rd] Windows, format.POSIXct and character encodings

2013-05-01 Thread Hadley Wickham
Hi all, In what encoding does format.POSIXct return its output? It doesn't seem to be utf-8: Sys.setlocale("LC_ALL", "Japanese_Japan.932") times <- c("1970-01-01 01:00:00 UTC", "1970-02-02 22:00:00 UTC") ampm <- format(as.POSIXct(times), format = "%p") x <- gsub(">", "*", paste(ampm, collapse =