Displaying 3 results from an estimated 3 matches for "x_nat".
Did you mean:
xt_nat
2017 Aug 01
3
special latin1 do not print as glyphs in current devel on windows
...uot; in cp1252, "2013" in
Unicode.
The same error seems to happen with
enc2utf8(x)
Now with iconv() the result is as expected.
iconv(x, to = "UTF-8")
The second problem IMO is that encoding markers get lost with the enc2*
functions
x_utf8 <- enc2utf8(x)
Encoding(x_utf8)
x_nat <- enc2native(x_utf8)
Encoding(x_nat)
Again, this is not the case with iconv()
x_iutf8 <- iconv(x, to = "UTF-8")
Encoding(x_iutf8)
x_inat <- iconv(x_iutf8, from = "UTF-8")
Encoding(x_inat)
[[alternative HTML version deleted]]
2017 Aug 01
0
special latin1 do not print as glyphs in current devel on windows
...result is as expected.
>
> iconv(x, to = "UTF-8")
>
>
> The second problem IMO is that encoding markers get lost with the enc2*
> functions
As you are changing encodings, you do not want to preserve encoding!
> x_utf8 <- enc2utf8(x)
> Encoding(x_utf8)
> x_nat <- enc2native(x_utf8)
> Encoding(x_nat)
In an actual Latin-1 locale on Linux
> x_utf8 <- c("??", "\u20ac", "\u2013")
> Encoding(x_utf8)
[1] "latin1" "UTF-8" "UTF-8"
> enc2native(x_utf8)
[1] "??" "...
2017 Aug 01
2
special latin1 do not print as glyphs in current devel on windows
...t Encoding() returns
"unknown".
In cp1252 encoding on Windows (note that I am using the cp1252 escape
"\x80" and not the Unicode "\u20AC")
> x_utf8 <- enc2utf8(c("?", "\x80"))
> Encoding(x_utf8)
[1] "UTF-8" "UTF-8"
> x_nat <- enc2native(x_utf8)
> Encoding(x_nat)
[1] "unknown" "unknown"
See also Kirill's message to this list: "ASCII strings are marked as ASCII
internally, but this information doesn't seem to be available, e.g.,
Encoding() returns "unknown" for such str...