From simon.urbanek at r-project.org  Mon Feb  3 17:43:55 2014
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Mon, 3 Feb 2014 11:43:55 -0500
Subject: [Rd] String Vector Encoding
In-Reply-To: <CAJDot1q8nHtPy+-dBx+DPQ5pZ+Fh4EQaEG=aAiiPD41-kOT6ew@mail.gmail.com>
References: <CAJDot1pchKieYXq3WcX7_36Kd9Hb5q8WB4+=8bMML=_9vt7+xQ@mail.gmail.com>
	<52EF7F79.8030101@gmail.com>
	<CAJDot1q8nHtPy+-dBx+DPQ5pZ+Fh4EQaEG=aAiiPD41-kOT6ew@mail.gmail.com>
Message-ID: <63E630B5-6511-4AA0-9352-153FE9F340A6@r-project.org>

On Feb 3, 2014, at 10:06 AM, Saptarshi Guha <saptarshi.guha at gmail.com> wrote:

> True but I was hoping someone could point me where in the source code this
> happens.
> 

src/main/serialize.c @1655 and @1663


> Cheers
> Saptarshi
> On Feb 3, 2014 3:37 AM, "Duncan Murdoch" <murdoch.duncan at gmail.com> wrote:
> 
>> On 14-02-03 3:41 AM, Saptarshi Guha wrote:
>> 
>>> Hello,
>>> 
>>> I was reading through serialize.c and i couldn't answer something.
>>> 
>>> In readItem, case CHARSXP,  rules exists to adjust the read string for
>>> string encoding.
>>> 
>> 
>> This is described in the R Internals manual.
>> 
>> Duncan Murdoch
>> 
>> 
>>> Q1. I couldn't find where the encoding of the elements of the string
>>> vector
>>> are written? Is it when writeItem writes out the attributes of the item?
>>> But i couldn't find encoding in the attributes field
>>> 
>>>  x <- "fa\xE7ile"
>>> Encoding(x) <- "latin1"
>>>  xx <- iconv(x, "latin1", "UTF-8")
>>> y=c(x,xx)
>>> attributes(y)
>>> 
>>> NULL
>>> 
>>> Apologies if this has been asked before
>>> Regards
>>> Saptarshi
>>> 
>>>        [[alternative HTML version deleted]]
>>> 
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>> 
>>> 
>> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] String Vector Encoding
Simon Urbanek