<p>From local testing, it looks like it should be configured in the <code>riotdocker</code> image.</p>
<p>Currently the locale in the container is <code>"POSIX"</code> whatever that means</p>
<pre><code>locale                                                                                                                                                                                                                                                                                    
LANG=                                                                                                                                                                                                                                                                                     
LANGUAGE=                                                                                                                                                                                                                                                                                 
LC_CTYPE="POSIX"                                                                                                                                                                                                                                                                          
LC_NUMERIC="POSIX"                                                                                                                                                                                                                                                                        
LC_TIME="POSIX"                                                                                                                                                                                                                                                                           
LC_COLLATE="POSIX"                                                                                                                                                                                                                                                                        
LC_MONETARY="POSIX"                                                                                                                                                                                                                                                                       
LC_MESSAGES="POSIX"                                                                                                                                                                                                                                                                       
LC_PAPER="POSIX"                                                                                                                                                                                                                                                                          
LC_NAME="POSIX"                                                                                                                                                                                                                                                                           
LC_ADDRESS="POSIX"                                                                                                                                                                                                                                                                        
LC_TELEPHONE="POSIX"                                                                                                                                                                                                                                                                      
LC_MEASUREMENT="POSIX"                                                                                                                                                                                                                                                                    
LC_IDENTIFICATION="POSIX"                                                                                                                                                                                                                                                                 
LC_ALL=                     
</code></pre>
<p>By doing a local test inspired from <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="423243945" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11220" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11220/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11220">#11220</a> it fails in the current <code>docker</code> image with a <code>samr21-xpro</code>.<br>
I could not run <code>native</code> though due to a <code>native_cpu_init: getcontext: Operation not permitted</code> issue so ignored it.</p>
<pre><code>BOARD=samr21-xpro make -C tests/lua_loader/ flash
DOCKER_FLAGS='--rm --privileged -i --group-add plugdev --group-add dialout --device=$(PORT)' BUILD_IN_DOCKER=1 DOCKER="sudo docker" BOARD=samr21-xpro make -C tests/lua_loader/ flash
</code></pre>
<p>The test fails due to the encoding errors.</p>
<pre><code>print((require"m2").a)
2019-07-11 14:40:12,635 - INFO # chega de repente
print((require"c1").X)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 48: ordinal not in range(128)
</code></pre>
<p>When adding <code>-e LC_ALL=C.UTF-8</code> it works:</p>
<details><summary><code>DOCKER_FLAGS='--rm --privileged -i --group-add plugdev --group-add dialout --device=$(PORT) -e LC_ALL=C.UTF-8' BUILD_IN_DOCKER=1 DOCKER="sudo docker" BOARD=samr21-xpro make -C tests/lua_loader/ test</code></summary>
<pre><code>DOCKER_FLAGS='--rm --privileged -i --group-add plugdev --group-add dialout --device=$(PORT) -e LC_ALL=C.UTF-8' BUILD_IN_DOCKER=1 DOCKER="sudo docker" BOARD=samr21-xpro make -C tests/lua_loader/ test
make: Entering directory '/home/harter/work/git/RIOT/tests/lua_loader'
Launching build container using image "riot/riotbuild:latest".
sudo docker run --rm --privileged -i --group-add plugdev --group-add dialout --device=/dev/ttyACM0 -e LC_ALL=C.UTF-8 -t -u "$(id -u)" \
    -v '/usr/share/zoneinfo/Europe/Berlin:/etc/localtime:ro' -v '/home/harter/work/git/RIOT:/data/riotbuild/riotbase' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles' -v /home/harter/.gitcache:/data/riotbuild/gitcache -e GIT_CACHE_DIR=/data/riotbuild/gitcache   \
    -e 'BOARD=samr21-xpro' \
    -w '/data/riotbuild/riotbase/tests/lua_loader/' \
    'riot/riotbuild:latest' make test
python3 -m easy_install --user pyserial
Searching for pyserial
Reading https://pypi.python.org/simple/pyserial/
Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl#sha256=e0770fadba80c31013896c7e6ef703f72e7834965954a78e71a3049488d4d7d8
Best match: pyserial 3.4
Processing pyserial-3.4-py2.py3-none-any.whl
Installing pyserial-3.4-py2.py3-none-any.whl to /data/riotbuild/.local/lib/python3.6/site-packages
Adding pyserial 3.4 to easy-install.pth file
Installing miniterm.py script to /data/riotbuild/.local/bin

Installed /data/riotbuild/.local/lib/python3.6/site-packages/pyserial-3.4-py3.6.egg
Processing dependencies for pyserial
Finished processing dependencies for pyserial
/data/riotbuild/riotbase/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2019-07-11 14:40:57,643 - INFO # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2019-07-11 14:41:00,825 - INFO # main(): This is RIOT! (Version: 2019.10-devel-25-g6b094)
2019-07-11 14:41:00,832 - INFO # I am a module, hi!
print((require"m1").a)
2019-07-11 14:41:00,895 - INFO # Quando uma lua
print((require"m2").a)
2019-07-11 14:41:00,957 - INFO # chega de repente
print((require"c1").X)
2019-07-11 14:41:01,019 - INFO # E se deixa no céu,
print((require"c2").X)
2019-07-11 14:41:01,081 - INFO # como esquecida

make: Leaving directory '/home/harter/work/git/RIOT/tests/lua_loader'
</code></pre>
</details>
<p>I used this minimal diff to put <code>test</code> in docker.</p>
<div class="highlight highlight-source-diff"><pre>git diff
<span class="pl-c1">diff --git a/Makefile.include b/Makefile.include</span>
index 37509aacb..6339bba60 100644
<span class="pl-md">--- a/Makefile.include</span>
<span class="pl-mi1">+++ b/Makefile.include</span>
<span class="pl-mdr">@@ -600,10 +600,15 @@</span> TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*[^~]),\
 # See #11762.
 TEST_DEPS += $(TERMDEPS)
 
<span class="pl-mi1"><span class="pl-mi1">+</span>ifeq ($(BUILD_IN_DOCKER),1)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>test: ..in-docker-container</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>else</span>
 test: $(TEST_DEPS)
<span class="pl-mi1"><span class="pl-mi1">+</span>       python3 -m easy_install --user pyserial</span>
        $(Q) for t in $(TESTS); do \
                $$t || exit 1; \
        done
<span class="pl-mi1"><span class="pl-mi1">+</span>endif</span>
 
 test/available:
        $(Q)test -n "$(strip $(TESTS))"
<span class="pl-c1">diff --git a/makefiles/docker.inc.mk b/makefiles/docker.inc.mk</span>
index d7249b5f5..ffb05efd1 100644
<span class="pl-md">--- a/makefiles/docker.inc.mk</span>
<span class="pl-mi1">+++ b/makefiles/docker.inc.mk</span>
<span class="pl-mdr">@@ -5,6 +5,7 @@</span> export DOCKER_FLAGS ?= --rm
 # List of Docker-enabled make goals
 export DOCKER_MAKECMDGOALS_POSSIBLE = \
   all \
<span class="pl-mi1"><span class="pl-mi1">+</span>  test \</span>
   buildtest \
   scan-build \
   scan-build-analyze \</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/issues/11691?email_source=notifications&email_token=ABE7WYEY757SAAH4EPWVWEDP64TQFA5CNFSM4HXYXN52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWSR7Q#issuecomment-510470398">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYEPWS6AS7Y2CI4YDN3P64TQFANCNFSM4HXYXN5Q">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYGVRRDFAPWEASXVLTDP64TQFA5CNFSM4HXYXN52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWSR7Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/11691?email_source=notifications\u0026email_token=ABE7WYEY757SAAH4EPWVWEDP64TQFA5CNFSM4HXYXN52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWSR7Q#issuecomment-510470398",
"url": "https://github.com/RIOT-OS/RIOT/issues/11691?email_source=notifications\u0026email_token=ABE7WYEY757SAAH4EPWVWEDP64TQFA5CNFSM4HXYXN52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWSR7Q#issuecomment-510470398",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>