UE solves the problem of Chinese input in Linux

#Solution for UE supporting Chinese input under Linux

**Recommendation: UE Web Browser - provides high-performance solutions for enterprises and organizations, focusing on Unreal Engine driven digital twins and AI driven rapid development. **We help businesses transform complex requirements into production ready interactive 3D applications, covering smart cities, industrial control platforms, data visualization, and immersive experiences.

**Fixed the issue where the UE5.1~UE5.8 Linux packaged versions cannot use the Chinese input method (Fcitx5/IBus). **

Warehouse address: https://github.com/starTechnology1994/uesdl


##Problem phenomenon

When running UE5 packaged applications on Linux, the Chinese input method is completely unavailable:

-The input method candidate box flashes and disappears after typing a character;
-Unable to form Pinyin, only one character can be typed at a time;
-The WebNativeBrowser input box and UMG native input box are both affected.


#root cause

SDL maintains two IME paths (XIM and D-Bus) simultaneously, which have key routing conflicts, resulting in Fcitx5/IBus (communicating through D-Bus) being unable to receive key events properly.


##Solution

Modify the SDL source code to skip XIM’s key interception when the D-Bus IME backend (Fcitx5/IBus) is activated, allowing all key events to be directly sent to the input method through D-Bus. At the same time, the function of following the focus of the IME candidate box position has been fixed.


#Linux environment requirements

The target Linux system requires the installation of one of the following input method frameworks:

###Fcitx5 (recommended)

# Deepin / Debian / Ubuntu
sudo apt install fcitx5 fcitx5-chinese-addons fcitx5-frontend-gtk2 fcitx5-frontend-gtk3 fcitx5-frontend-qt5

IBus

# Deepin / Debian / Ubuntu
sudo apt install ibus ibus-libpinyin

After installation, the input method framework needs to be set to Fcitx5 or IBus in the system settings, and ensure that the ‘fcitx5’ or ‘iBus daemon’ processes have been started.


##Usage method

Replace the corresponding SDL static library file in the UE engine installation directory directly, and backup the original file before replacement.

1. Find the corresponding library based on the UE version

The directory structure of this warehouse is:

├── UE5.1_SDL2_2.0.20/
│   ├── x86_64/libSDL2_fPIC.a
│   └── arm64/libSDL2_fPIC.a
├── UE5.2_SDL2_2.24.0/
├── UE5.3_SDL2_2.24.0/
├── UE5.4_SDL2_2.24.0/
├── UE5.5_SDL2_2.30.6/
├── UE5.6_SDL2_2.30.6/
├── UE5.7_SDL3_3.2.10/
│   ├── x86_64/libSDL3_fPIC.a
│   └── arm64/libSDL3_fPIC.a
└── UE5.8_SDL3_3.4.4/
├── x86_64/libSDL3_fPIC.a
└── arm64/libSDL3_fPIC.a

2. Replace to engine installation directory

UE5.1 ~ UE5.6(SDL2)

Architecture Replace Path
X86_64 {UE installation directory}\ Engine\Source\ThirdParty\SDL2\SDL-gui-backend\lib\Unix\x86_64-unknown-linux-gnu\libSDL2_fPIC.a
Arm64 {UE installation directory}\ Engine\Source\ThirdParty\SDL2\SDL-gui-backend\lib\Unix\aarch64-unknown-linux-gnueabi\libSDL2_fPIC.a

Example:

# x86_64
Copy-Item ".\UE5.1_SDL2_2.0.20\x86_64\libSDL2_fPIC.a" `
"E:\Program Files\Epic Games\UE_5.1\Engine\Source\ThirdParty\SDL2\SDL-gui-backend\lib\Unix\x86_64-unknown-linux-gnu\libSDL2_fPIC.a"

# arm64
Copy-Item ".\UE5.1_SDL2_2.0.20\arm64\libSDL2_fPIC.a" `
"E:\Program Files\Epic Games\UE_5.1\Engine\Source\ThirdParty\SDL2\SDL-gui-backend\lib\Unix\aarch64-unknown-linux-gnueabi\libSDL2_fPIC.a"

UE5.7 ~ UE5.8(SDL3)

Architecture Replace Path
X86_64 {UE installation directory}\ Engine\Source\ThirdParty\SDL3\SDL-gui-backend\lib\Unix\x86_64-unknown-linux-gnu\libSDL3_fPIC.a
Arm64 {UE installation directory}\ Engine\Source\ThirdParty\SDL3\SDL-gui-backend\lib\Unix\aarch64-unknown-linux-gnu\libSDL3_fPIC.a

Example:

# x86_64
Copy-Item ".\UE5.7_SDL3_3.2.10\x86_64\libSDL3_fPIC.a" `
"E:\Program Files\Epic Games\UE_5.7\Engine\Source\ThirdParty\SDL3\SDL-gui-backend\lib\Unix\x86_64-unknown-linux-gnu\libSDL3_fPIC.a"

# arm64
Copy-Item ".\UE5.7_SDL3_3.2.10\arm64\libSDL3_fPIC.a" `
"E:\Program Files\Epic Games\UE_5.7\Engine\Source\ThirdParty\SDL3\SDL-gui-backend\lib\Unix\aarch64-unknown-linux-gnu\libSDL3_fPIC.a"
    • Note * *: UE5.7 and UE5.8 use SDL3, and the replacement directory is’ SDL3 ‘instead of’ SDL2 '.

3. repack

Replace and repackage the Linux version, and the Chinese input method will work normally.


#compatibility

-* * Fcitx5 * : Input Chinese normally
-
* IBus * : Input Chinese normally
-
* Pure XIM environment (without D-Bus IME) * *: Fallback the original logic without being affected
-Windows/macOS: Not affected by this code path

If this article is helpful to you, please feel free to like and save it. For complete documentation and examples of WebNativeBrowser, you can visit our GitHub repository:
https://github.com/starTechnology1994/uewebbrowser