diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 49bc02658..5ec8918ca 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -7,6 +7,29 @@ endif
 let s:x11_based_gui = has('gui_athena') || has('gui_motif')
 	\ || has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
 
+" List of human-readable reasons why the test was skipped.  The list index
+" should be taken from the value of the local 'skipped' variable.
+let s:reason = [
+      \ "Skipped: Should not happen (Must be a test script bug)",
+      \ "Skipped: Test not implemented yet for this GUI",
+      \ "Skipped: Test not supported by the system/environment",
+      \ "Skipped: Feature/Option not supported by this GUI",
+      \]
+" The possible values of 'skipped'.  The order matters and must be consistent
+" with that of s:reason as well as the number of the possible values.
+let s:should_not_skip = 0
+let s:not_implemented = 1
+let s:unable_to_test  = 2
+let s:not_supported   = 3
+let s:reason_last     = 4
+" Auxiliary function to verify the range of the 'skipped' variable
+func s:ShouldSkip(val)
+  if a:val < s:should_not_skip || a:val >= s:reason_last
+    throw s:reason[0]
+  endif
+  return a:val == s:should_not_skip ? 0 : 1
+endfunc
+
 " For KDE set a font, empty 'guifont' may cause a hang.
 func SetUp()
   if has("gui_kde")
@@ -80,7 +103,7 @@ func Test_set_guifont()
     set guifontset=
   endif
 
-  let skipped = 0
+  let l:skipped = s:should_not_skip
   if has('gui_athena') || has('gui_motif')
     " Non-empty font list with invalid font names.
     "
@@ -118,7 +141,7 @@ func Test_set_guifont()
     call assert_equal('Monospace 10', getfontname())
 
   else
-    let skipped = 1
+    let l:skipped = s:not_implemented
   endif
 
   if has('xfontset')
@@ -126,13 +149,13 @@ func Test_set_guifont()
   endif
   let &guifont = l:guifont_saved
 
-  if skipped
-    throw "Skipped: Test not implemented yet for this GUI"
+  if s:ShouldSkip(l:skipped)
+    throw s:reason[l:skipped]
   endif
 endfunc
 
 func Test_set_guifontset()
-  let skipped = 0
+  let l:skipped = s:should_not_skip
 
   if has('xfontset')
     let l:ctype_saved = v:ctype
@@ -142,53 +165,64 @@ func Test_set_guifontset()
     " the host system to have a fairly comprehensive collection of fixed-width
     " fonts with various sizes and registries/encodings in order to get the
     " job done.  To make the test meaningful for a wide variety of hosts, we
-    " confine ourselves to the following locale for which X11 historically has
-    " the fonts to use with.
-    language ctype ja_JP.eucJP
+    " confine ourselves to the locale ja_JP.eucJP for which X11 has had the
+    " fonts to use with for decades.
+    "
+    " A certain environment doesn't allow us to set LC_CTYPE to ja_JP.eucJP
+    " through :language.  If this is the case, we skip the test.  This is a
+    " reasonable compromise because such an environment is highly unlikely to
+    " support the 2-byte characters of the traditional encodings, thereby
+    " defeating the very purpose of XFontSet, and thus not suitable to host
+    " this particular test.
+    try
+      language ctype ja_JP.eucJP
+    catch /^Vim\%((\a\+)\)\=:E197/
+      exec 'language ctype' l:ctype_saved
+      let l:skipped = s:unable_to_test
+    finally
+      " Since XCreateFontSet(3) is very sensitive to locale, fonts must be
+      " chosen meticulously.
+      let l:font_head = '-misc-fixed-medium-r-normal--14'
 
-    " Since XCreateFontSet(3) is very sensitive to locale, fonts must be
-    " chosen meticulously.
-    let l:font_head = '-misc-fixed-medium-r-normal--14'
+      let l:font_aw70 = l:font_head . '-130-75-75-c-70'
+      let l:font_aw140 = l:font_head . '-130-75-75-c-140'
 
-    let l:font_aw70 = l:font_head . '-130-75-75-c-70'
-    let l:font_aw140 = l:font_head . '-130-75-75-c-140'
+      let l:font_jisx0201 = l:font_aw70 . '-jisx0201.1976-0'
+      let l:font_jisx0208 = l:font_aw140 . '-jisx0208.1983-0'
 
-    let l:font_jisx0201 = l:font_aw70 . '-jisx0201.1976-0'
-    let l:font_jisx0208 = l:font_aw140 . '-jisx0208.1983-0'
+      " Full XLFDs
+      let l:fontset_name = join([ l:font_jisx0208, l:font_jisx0201 ], ',')
+      exec 'set guifontset=' . l:fontset_name
+      call assert_equal(l:fontset_name, &guifontset)
 
-    " Full XLFDs
-    let l:fontset_name = join([ l:font_jisx0208, l:font_jisx0201 ], ',')
-    exec 'set guifontset=' . l:fontset_name
-    call assert_equal(l:fontset_name, &guifontset)
+      " XLFDs w/o CharSetRegistry and CharSetEncoding
+      let l:fontset_name = join([ l:font_aw140, l:font_aw70 ], ',')
+      exec 'set guifontset=' . l:fontset_name
+      call assert_equal(l:fontset_name, &guifontset)
 
-    " XLFDs w/o CharSetRegistry and CharSetEncoding
-    let l:fontset_name = join([ l:font_aw140, l:font_aw70 ], ',')
-    exec 'set guifontset=' . l:fontset_name
-    call assert_equal(l:fontset_name, &guifontset)
+      " Singleton
+      let l:fontset_name = l:font_head . '-*'
+      exec 'set guifontset=' . l:fontset_name
+      call assert_equal(l:fontset_name, &guifontset)
 
-    " Singleton
-    let l:fontset_name = l:font_head . '-*'
-    exec 'set guifontset=' . l:fontset_name
-    call assert_equal(l:fontset_name, &guifontset)
-
-    " Aliases
-    let l:fontset_name = 'k14,r14'
-    exec 'set guifontset=' . l:fontset_name
-    call assert_equal(l:fontset_name, &guifontset)
-
-    exec 'language ctype' l:ctype_saved
+      " Aliases
+      let l:fontset_name = 'k14,r14'
+      exec 'set guifontset=' . l:fontset_name
+      call assert_equal(l:fontset_name, &guifontset)
 
+      exec 'language ctype' l:ctype_saved
+    endtry
   else
-    let skipped = 1
+    let l:skipped = s:not_supported
   endif
 
-  if skipped
-    throw "Skipped: Not supported by this GUI"
+  if s:ShouldSkip(l:skipped)
+    throw s:reason[l:skipped]
   endif
 endfunc
 
 func Test_set_guifontwide()
-  let skipped = 0
+  let l:skipped = s:should_not_skip
 
   if has('gui_gtk')
     let l:guifont_saved = &guifont
@@ -196,12 +230,12 @@ func Test_set_guifontwide()
 
     let l:fc_match = exepath('fc-match')
     if l:fc_match != ''
-      let &guifont = system('fc-match -f "%{family[0]} %{size}" monospace:size=10')
+      let &guifont = system('fc-match -f "%{family[0]} %{size}" monospace:size=10:lang=en')
       let l:wide = system('fc-match -f "%{family[0]} %{size}" monospace:size=10:lang=ja')
       exec 'set guifontwide=' . fnameescape(l:wide)
       call assert_equal(l:wide, &guifontwide)
     else
-      let skipped = 3
+      let l:skipped = s:unable_to_test
     endif
 
     let &guifontwide = l:guifontwide_saved
@@ -258,18 +292,14 @@ func Test_set_guifontwide()
       let &guifont = l:guifont_saved
       let &encoding = l:encoding_saved
     else
-      let skipped = 2
+      let l:skipped = s:not_supported
     endif
   else
-    let skipped = 1
+    let l:skipped = s:not_implemented
   endif
 
-  if skipped == 1
-    throw "Skipped: Test not implemented yet for this GUI"
-  elseif skipped == 2
-    throw "Skipped: Not supported by this GUI"
-  elseif skipped == 3
-    throw "Skipped: Test not supported by the environment"
+  if s:ShouldSkip(l:skipped)
+    throw s:reason[l:skipped]
   endif
 endfunc
 
