Skip to content

Commit

Permalink
Restrict 79761 to Solaris.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@80152 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
kalibera committed Apr 9, 2021
1 parent b5ba09a commit ec0761e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/printutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ int Rstrwid(const char *str, int slen, cetype_t ienc, int quote)
/* Need to avoid mbtrowc on Solaris, where it only covers the BMP
so we set ienc for unmarked strings in a UTF-8 locale */
Rboolean useUTF8 = (ienc == CE_UTF8) || utf8locale;
if (ienc == CE_LATIN1)
/* Future-proof, cannot happen now. */
warning("unexpected encoding (%d) in Rstrwid", ienc);
#else
Rboolean useUTF8 = (ienc == CE_UTF8);
#endif
Expand Down Expand Up @@ -613,6 +616,7 @@ const char *EncodeString(SEXP s, int w, int quote, Rprt_adj justify)
ienc = CE_UTF8;
}
#endif
#ifdef __sun
} else if(ienc == CE_LATIN1) {
p = translateCharUTF8(s);
if(p == CHAR(s)) {
Expand All @@ -623,6 +627,7 @@ const char *EncodeString(SEXP s, int w, int quote, Rprt_adj justify)
i = Rstrwid(p, cnt, CE_UTF8, quote);
}
ienc = CE_UTF8;
#endif
} else {
if (useUTF8 && ienc == CE_UTF8) {
p = CHAR(s);
Expand Down Expand Up @@ -670,6 +675,7 @@ const char *EncodeString(SEXP s, int w, int quote, Rprt_adj justify)
#ifdef __sun
/* Need to avoid mbtrowc on Solaris, where it only covers the BMP
so we set ienc for unmarked strings in a UTF-8 locale */
/* Latin-1 string would have been converted to UTF-8 above. */
Rboolean useUTF8 = (ienc == CE_UTF8) || utf8locale;
#else
Rboolean useUTF8 = (ienc == CE_UTF8);
Expand Down

0 comments on commit ec0761e

Please sign in to comment.