patch 9.1.0709: GUIEnter event not found in Turkish locale

Problem:   GUIEnter not found in Turkish locale
           (James McCoy, after v9.1.0256, the issue was there before,
            but v9.1.0256 made it more apparent)
Solution:  explicitly compare autocommand events by ASCII value and
           ignoring locale, because according to the documentation,
           events are case insensitive (:h autocommand-events)

fixes: #15574
closes: #15603

Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 5a91351..a863a23 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -4863,5 +4863,24 @@
   let &cmdheight=_cmdheight
 endfunc
 
+" The specifics of the turkish locale may
+" cause that Vim will not treat the GuiEnter autocommand
+" as case insensitive and instead issues an error
+func Test_GuiEnter_Turkish_locale()
+  try
+    let lng = v:lang
+    lang tr_TR.UTF-8
+    let result = execute(':au GuiEnter')
+    call assert_equal("\n--- Autocommands ---", result)
+    let result = execute(':au GUIENTER')
+    call assert_equal("\n--- Autocommands ---", result)
+    let result = execute(':au guienter')
+    call assert_equal("\n--- Autocommands ---", result)
+    exe ":lang" lng
+  catch /E197:/
+    " can't use Turkish locale
+    throw 'Skipped: Turkish locale not available'
+  endtry
+endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab