From tom@@@k@||ber@ @end|ng |rom gm@||@com  Thu Apr 11 08:10:53 2019
From: tom@@@k@||ber@ @end|ng |rom gm@||@com (Tomas Kalibera)
Date: Thu, 11 Apr 2019 08:10:53 +0200
Subject: [Rd] 
 R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code
 are simplified to wrong ones
In-Reply-To: <CAAg2Tg+5bfui6xZE_C6UFr_6Ca+4BRJkHFBniJQwy2oGdByV_g@mail.gmail.com>
References: <CAAg2TgJboQWc3QAeR_snGEMxkmaTbkf5B331qtkvgn_BO2w1nA@mail.gmail.com>
 <CABFfbXuciaNVbyufSjXxAXs4V2jbZZxsbaChEBmzaPWOzCc6yg@mail.gmail.com>
 <8a6c13fb-ce7d-eba9-0a93-44c52a859e75@gmail.com>
 <CAAg2TgJtxkQZhgL3KkovE2mKg_3XwDOZTb84+N_0iR1AX0kZ=g@mail.gmail.com>
 <bed5b18d-6fe1-2611-a856-fb9d5642ecd7@gmail.com>
 <CAAg2TgKKvaDO7+h4pmGhD87HdgtH5o620Sm7TwbbqxTb1dY6zg@mail.gmail.com>
 <68db5e12-e983-e818-49f6-2cdc87c365c2@gmail.com>
 <CAAg2TgKgKW7kCXx91H5qYTrCYgvpRd=gH6Y6HNe50B4Tw1sh1g@mail.gmail.com>
 <23428aeb-0894-bbe6-bebb-1def4d0a9230@gmail.com>
 <CAAg2Tg+5bfui6xZE_C6UFr_6Ca+4BRJkHFBniJQwy2oGdByV_g@mail.gmail.com>
Message-ID: <afeb36f5-c34d-c96e-047d-d3c608c651ae@gmail.com>

On 4/10/19 6:13 PM, Tom?? Bo?il wrote:

> An optional parameter to source() function which would translate all
> UTF-8 characters in string literals to their "\Uxxxx" codes sounds as
> a great idea (and I hope it would fix 99.9% of problems I have -
> because that is the way I overcome these problems nowadays) - and the
> same behaviour in command line...

I was not suggesting to convert to \Uxxxx in source(). Some users do it 
in their programs by hand or an external utility. Source() in principle 
could be made work similarly to eval(parse(file,encoding=)) with respect 
to encodings, via other means, we will consider that but there are many 
remaining places where the conversion happens - a trivial one is that 
currently you cannot print the result of the parse() from your example 
properly. Maybe you don't trigger such problems in your scripts in 
obvious ways, but as I said before, if you want to work reliably with 
characters not representable in current native encoding, in current or 
near version of R, use Linux or macOS.

Tomas

>
> Tomas



[Rd] R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
Tomas Kalibera