Skip to content

Commit

Permalink
only change locate for R 4.2 windows
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed Aug 20, 2023
1 parent 60ccb0a commit 4137b2c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions radian/rutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ def register_cleanup(cleanup):

def set_locale(lc_ctype):
if sys.platform.startswith("win"):
if not os.environ.get("LANG", ""):
if rcopy(reval(
'compareVersion(paste0(R.version$major, ".", R.version$minor), "4.2.0") >= 0')):
os.environ["LANG"] = "en_US.UTF-8"
if lc_ctype:
reval("suppressWarnings(Sys.setlocale(locale = '{}'))".format(lc_ctype))
ucrt = rcopy(
reval('compareVersion(paste0(R.version$major, ".", R.version$minor), "4.2.0") >= 0'))
if ucrt:
if not os.environ.get("LANG", ""):
os.environ["LANG"] = "en_US.UTF-8"
if lc_ctype:
reval("suppressWarnings(Sys.setlocale(locale = '{}'))".format(lc_ctype))


def run_on_load_hooks():
Expand Down

0 comments on commit 4137b2c

Please sign in to comment.