Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,52 @@ jobs:
- uses: yihui/actions/check-r-package@HEAD
with:
check-args: "--no-manual --as-cran"

R-CMD-check-locale:
runs-on: ${{ matrix.os }}

name: ${{ matrix.os }}, R-${{ matrix.r }}, LC_CTYPE=${{ matrix.locale }}

strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
r: ['release']
locale: ['fr_CA.ISO-8859-1', 'zh_CN.GB18030', 'ru_RU.KOI8-R']

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r }}

- name: Configure locale
run: |
echo ${{ matrix.locale }} `echo ${{ matrix.locale }} | sed 's/.*\.//'` | sudo tee -a /etc/locale.gen
sudo locale-gen --keep-existing

- uses: yihui/actions/setup-r-dependencies@HEAD

- name: Override R for locale-specific check
run: |
sudo mkdir -p /override
# poor man's luit that doesn't require a tty
sudo tee /override/R <<EOF # no quotes => expand backticks, dollars
#!/bin/bash
set -o pipefail
exec stdbuf -o L -e L `which R` "\$@" 2>&1 | while read line; do
echo "\$line" | iconv -t UTF-8
done
EOF
sudo chmod +x /override/R
echo PATH=/override:$PATH >> $GITHUB_ENV

- uses: yihui/actions/check-r-package@HEAD
with:
check-args: "--no-manual"
env:
LC_CTYPE: ${{ matrix.locale }}
2 changes: 1 addition & 1 deletion inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -20308,7 +20308,7 @@ local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc"))) {
# a-umlaut, o-umlaut, u-umlaut
eval(parse(text = ' # eval(parse()) defers parsing to runtime; see utf8_check description
setnames(x , c("\u00e4", "\u00f6", "\u00fc"))
setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), from = "UTF-8", to = "latin1"))
setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), from = "", to = "latin1"))
test(2298.1, rbindlist(list(x,y), use.names=TRUE), data.table("\u00e4"=c(1,6), "\u00f6"=c(2,4), "\u00fc"=c(3,5)))
test(2298.2, rbindlist(list(y,x), use.names=TRUE), data.table("\u00f6"=c(4,2), "\u00fc"=c(5,3), "\u00e4"=c(6,1)))
set(y, j="\u00e4", value=NULL)
Expand Down
Loading