We have recently had some users with either the Swedish or German language report an issue where they cannot type in a textedit (textbox) control.
They can paste text inside the control using the right click on the mouse but as long as the keyboard is used the following error will pop up :
CultureNotFoundException - Culture is not supported. (Parameter 'culture')
4096 (0x1000) is an invalid culture identifier.
at System.Globalization.CultureInfo.GetCultureInfo(Int32 culture)
at System.Windows.Forms.InputLanguage.get_LanguageTag()
at System.Windows.Forms.InputLanguage.get_Culture()
at DevExpress.XtraEditors.TextEditController.InputHandler.InputHandler.get_AllowUpdateRightToLeft()
at DevExpress.XtraEditors.TextEditController.InputHandler.InputHandler.CheckTextDirection(Keys key, Boolean keyUp)
at DevExpress.XtraEditors.TextEditController.TextEditController.OnKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.TextEdit.AdvTextEditWorkingStrategy.OnKeyDown(KeyEventArgs keyEventArgs)
at DevExpress.XtraEditors.TextEdit.OnKeyDown(KeyEventArgs e)
at Devolutions.RemoteDesktopManager.Controls.PasswordTextBox.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.Utils.Controls.ControlBase.BaseWndProc(Message& m)
at DevExpress.XtraEditors.TextEdit.BaseEditWndProc(Message& msg)
at DevExpress.XtraEditors.TextEdit.WndProc(Message& msg)
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
The textedit is a DevExpress control but I am not completely certain the issue lies there because the error seems to happen when calling “System” methods.
We have tried reproducing with a computer where we installed a native Swedish Windows OS and forced the UICulture and the Culture to the same as the user (Swedish) using the PowerShell commands Set-WinUILanguageOverride sv-SE
and Set-WinUserLanguageList sv-SE -Force
but we cannot reproduce our user’s issue.
I have come across information here where it says the following about the code 4096 (0x1000)
:
In most cases, the culture identifier is mapped to the corresponding
NLS locale identifier.In versions of Windows prior to Windows 10, the locale identifier
LOCALE_CUSTOM_UNSPECIFIED (0x1000, or 4096) is assigned to custom
cultures created by the user. Starting with Windows 10, it is assigned
to any culture that does not have a unique locale identifier and does
not have complete system-provided data. As a result, code that
iterates cultures and retrieves those with an LCID value of
LOCALE_CUSTOM_UNSPECIFIED returns a larger subset of CultureInfo
objects if run under Windows 10.
Our users use the Windows versions Windows 11 Version 23H2 (OS Build 22631.3527) 64-bit
and Windows 2016 Version 21H2 (OS Build 20348.2402) 64-bit
Any ideas on what could be the issue and how to fix it?