Displaying 6 results from an estimated 6 matches for "u00159".
2019 Apr 10
5
R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
...lified" by the OS before processing, leading to undesirable
changes.
Minimalistic example:
Let's type "?" (LATIN SMALL LETTER R WITH CARON) in RGui console:
> "?"
[1] "r"
Let's assume the following script:
# file [script.R]
if ("?" != "\U00159") {
stop("Problem: Unexpected character conversion.")
} else {
cat("o.k.\n")
}
Problem:
source("script.R", encoding = "UTF-8")
OK (see https://stackoverflow.com/questions/5031630/how-to-source-r-file-saved-using-utf-8-encoding):
eval(parse(&quo...
2019 Apr 10
2
R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
...Mac OS, Linux...)
> I think this is a "feature" of win_iconv that is bundled with base R
> on Windows (./src/extra/win_iconv). The character from your example is
> not part of the latin1 (iso-8859-1) set, however, win-iconv seems to
> do so anyway:
>
>> x <- "\U00159"
>> print(x)
> [1] "?"
>> iconv(x, 'UTF-8', 'iso-8859-1')
> [1] "r"
>
> On MacOS, iconv tells us this character cannot be represented as latin1:
>
>> x <- "\U00159"
>> print(x)
> [1] "?"
>&g...
2019 Apr 10
0
R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
...rced by source(encoding=) ?
>
> And, are you using Rgui as front-end?
>> The only problem is that I
>> cannot simple use enc2utf8("?") - it is converted to "o" before
>> executing the function. Instead of that, I have to explicitly type
>> "\U00159" throughout my code.
On Wed, Apr 10, 2019 at 5:29 PM Tomas Kalibera <tomas.kalibera at gmail.com> wrote:
>
> On 4/10/19 3:02 PM, Tom?? Bo?il wrote:
> > The thing is, I would rather prefer R (in that rare occasions where an
> > old function does not support anything but...
2019 Apr 10
0
R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
...r on OS with UTF-8 locale (Mac OS, Linux...)
I think this is a "feature" of win_iconv that is bundled with base R
on Windows (./src/extra/win_iconv). The character from your example is
not part of the latin1 (iso-8859-1) set, however, win-iconv seems to
do so anyway:
> x <- "\U00159"
> print(x)
[1] "?"
> iconv(x, 'UTF-8', 'iso-8859-1')
[1] "r"
On MacOS, iconv tells us this character cannot be represented as latin1:
> x <- "\U00159"
> print(x)
[1] "?"
> iconv(x, 'UTF-8', 'iso-8859-1'...
2019 Apr 10
0
R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
...think this is a "feature" of win_iconv that is bundled with base R
> > on Windows (./src/extra/win_iconv). The character from your example is
> > not part of the latin1 (iso-8859-1) set, however, win-iconv seems to
> > do so anyway:
> >
> >> x <- "\U00159"
> >> print(x)
> > [1] "?"
> >> iconv(x, 'UTF-8', 'iso-8859-1')
> > [1] "r"
> >
> > On MacOS, iconv tells us this character cannot be represented as latin1:
> >
> >> x <- "\U00159"
> &g...
2019 Apr 10
3
R 3.5.3 and 3.6.0 alpha Windows bug: UTF-8 characters in code are simplified to wrong ones
..."feature" of win_iconv that is bundled with base R
>>> on Windows (./src/extra/win_iconv). The character from your example is
>>> not part of the latin1 (iso-8859-1) set, however, win-iconv seems to
>>> do so anyway:
>>>
>>>> x <- "\U00159"
>>>> print(x)
>>> [1] "?"
>>>> iconv(x, 'UTF-8', 'iso-8859-1')
>>> [1] "r"
>>>
>>> On MacOS, iconv tells us this character cannot be represented as latin1:
>>>
>>>> x <- &qu...