diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md
index aa02baff1f..fc773b6a28 100644
--- a/tests/FILEFORMAT.md
+++ b/tests/FILEFORMAT.md
@@ -432,6 +432,7 @@ Features testable here are:
- `brotli`
- `c-ares`
- `CharConv`
+- `codeset-utf8`. If the running codeset is UTF-8 capable.
- `cookies`
- `crypto`
- `Debug`
diff --git a/tests/data/test1034 b/tests/data/test1034
index 09a4dd5f3f..7e62f6d63b 100644
--- a/tests/data/test1034
+++ b/tests/data/test1034
@@ -26,14 +26,12 @@ none
IDN
http
proxy
+codeset-utf8
LC_ALL=
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
HTTP over proxy with malformatted IDN host name
diff --git a/tests/data/test1035 b/tests/data/test1035
index 0bbaabf9c8..e162022fe8 100644
--- a/tests/data/test1035
+++ b/tests/data/test1035
@@ -24,19 +24,17 @@ none
IDN
http
proxy
+codeset-utf8
LC_ALL=
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
HTTP over proxy with too long IDN host name
-http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/%TESTNUMBER -x %HOSTIP:%NOLISTENPORT
+http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/%TESTNUMBER -x %HOSTIP:%NOLISTENPORT
diff --git a/tests/data/test1448 b/tests/data/test1448
index 1544d3936f..33aedc4f01 100644
--- a/tests/data/test1448
+++ b/tests/data/test1448
@@ -40,14 +40,12 @@ http
IDN
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
Redirect following to UTF-8 IDN host name
diff --git a/tests/data/test165 b/tests/data/test165
index e9237d89cd..39787db87e 100644
--- a/tests/data/test165
+++ b/tests/data/test165
@@ -30,14 +30,12 @@ http
IDN
proxy
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
HTTP over proxy with IDN host name
diff --git a/tests/data/test2046 b/tests/data/test2046
index 3aefd25c96..c0d3a0e825 100644
--- a/tests/data/test2046
+++ b/tests/data/test2046
@@ -40,14 +40,12 @@ http
IDN
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
Connection reuse with IDN host name
diff --git a/tests/data/test2047 b/tests/data/test2047
index 82e9a14aaa..1d7be6db36 100644
--- a/tests/data/test2047
+++ b/tests/data/test2047
@@ -41,14 +41,12 @@ http
IDN
proxy
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
Connection reuse with IDN host name over HTTP proxy
diff --git a/tests/data/test955 b/tests/data/test955
index 24cc2b7e43..982afc352e 100644
--- a/tests/data/test955
+++ b/tests/data/test955
@@ -21,14 +21,12 @@ smtp
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP without SMTPUTF8 support - UTF-8 based sender (local part only)
diff --git a/tests/data/test956 b/tests/data/test956
index 1180523bbd..22bf3a14fa 100644
--- a/tests/data/test956
+++ b/tests/data/test956
@@ -18,14 +18,12 @@ smtp
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP without SMTPUTF8 support - UTF-8 based recipient (local part only)
diff --git a/tests/data/test957 b/tests/data/test957
index 1b01b7e53a..d49739d84f 100644
--- a/tests/data/test957
+++ b/tests/data/test957
@@ -19,14 +19,12 @@ smtp
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP VRFY without SMTPUTF8 support - UTF-8 based recipient (local part only)
diff --git a/tests/data/test958 b/tests/data/test958
index 3ad77fe103..ea5a2dbae6 100644
--- a/tests/data/test958
+++ b/tests/data/test958
@@ -19,14 +19,12 @@ smtp
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP external VRFY without SMTPUTF8 support - UTF-8 based recipient (local part only)
diff --git a/tests/data/test959 b/tests/data/test959
index 421d6ba987..178e0f13c4 100644
--- a/tests/data/test959
+++ b/tests/data/test959
@@ -22,14 +22,12 @@ smtp
!IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP without SMTPUTF8 support - UTF-8 based sender (host part only)
diff --git a/tests/data/test960 b/tests/data/test960
index 9f33fdc797..2cf348eb53 100644
--- a/tests/data/test960
+++ b/tests/data/test960
@@ -19,14 +19,12 @@ smtp
!IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP without SMTPUTF8 support - UTF-8 based recipient (host part only)
diff --git a/tests/data/test961 b/tests/data/test961
index c416b97614..57958a4eb0 100644
--- a/tests/data/test961
+++ b/tests/data/test961
@@ -20,14 +20,12 @@ smtp
!IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP external VRFY without SMTPUTF8 support - UTF-8 based recipient (host part only)
diff --git a/tests/data/test962 b/tests/data/test962
index 09bfb51000..6ac4ab08c2 100644
--- a/tests/data/test962
+++ b/tests/data/test962
@@ -20,14 +20,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP without SMTPUTF8 support - UTF-8 based sender (host part only)
diff --git a/tests/data/test963 b/tests/data/test963
index 02fc0b851b..9fe94f894c 100644
--- a/tests/data/test963
+++ b/tests/data/test963
@@ -20,14 +20,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP without SMTPUTF8 support (IDN Enabled) - UTF-8 based recipient (host part only)
diff --git a/tests/data/test964 b/tests/data/test964
index e03dc333e4..05dbda9319 100644
--- a/tests/data/test964
+++ b/tests/data/test964
@@ -21,14 +21,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP external VRFY without SMTPUTF8 support (IDN Enabled) - UTF-8 based recipient (host part only)
diff --git a/tests/data/test965 b/tests/data/test965
index f8adbdefe9..f44239e784 100644
--- a/tests/data/test965
+++ b/tests/data/test965
@@ -23,14 +23,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP with SMTPUTF8 support - UTF-8 based sender
diff --git a/tests/data/test966 b/tests/data/test966
index e43f860ec4..31b6c288f1 100644
--- a/tests/data/test966
+++ b/tests/data/test966
@@ -23,14 +23,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP with SMTPUTF8 support - UTF-8 based recipient
diff --git a/tests/data/test967 b/tests/data/test967
index 898fbb106b..d823b4839e 100644
--- a/tests/data/test967
+++ b/tests/data/test967
@@ -27,14 +27,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP external VRFY with SMTPUTF8 support
diff --git a/tests/data/test968 b/tests/data/test968
index c27a3675f8..b057be6291 100644
--- a/tests/data/test968
+++ b/tests/data/test968
@@ -24,14 +24,12 @@ smtp
IDN
!win32
+codeset-utf8
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
-
-perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(langinfo(CODESET())) ne "utf-8");'
-
SMTP VRFY with SMTPUTF8 support
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 4764ba31aa..197e145896 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -83,6 +83,7 @@ BEGIN {
use Digest::MD5 qw(md5);
use List::Util 'sum';
+use I18N::Langinfo qw(langinfo CODESET);
use pathhelp qw(
exe_ext
@@ -825,6 +826,7 @@ sub checksystemfeatures {
$feature{"large-time"} = 1;
$feature{"sha512-256"} = 1;
$feature{"local-http"} = servers::localhttp();
+ $feature{"codeset-utf8"} = lc(langinfo(CODESET())) eq "utf-8";
# make each protocol an enabled "feature"
for my $p (@protocols) {