Problem:
When a player with special characters in their Steam name (e.g., umlauts like ä, ö, ü, accents, or spaces) connects to a dedicated server, the server stores the whitelist in memory. On shutdown (graceful stop or restart), the server writes the whitelist back to disk – but changes the encoding from UTF-8 to UTF-16 LE BOM.
On the next server start, the server fails to read the UTF-16 encoded file.
All players are incorrectly rejected as “not whitelisted” even though their SteamID is still in the file.
This bug has existed since at least 2020 and still occurs in Conan Exiles Enhanced (UE5).
Workaround:
A batch script that runs before the server starts. It checks the encoding of whitelist.txt and – if UTF-16 LE BOM is detected – converts it back to UTF-8 without BOM.
Use the “Run .BAT on Startup” function of the Dedicated Server Launcher. It will execute the script automatically before every server start.
The script creates a backup before making any changes.
The script:
Save as FixUTF16Whitelist.bat.
@echo off
setlocal enabledelayedexpansion
set "BASE_PATH=D:\Games\ConanExilesServer_1\DedicatedServerLauncher\ConanExilesDedicatedServer\ConanSandbox\Saved"
set "WHITELIST=%BASE_PATH%\whitelist.txt"
if not exist "%WHITELIST%" exit /b 0
:: Check for UTF-16 LE BOM (FF FE)
powershell -command "$bytes = [System.IO.File]::ReadAllBytes('%WHITELIST%'); if ($bytes[0] -eq 0xFF -and $bytes[1] -eq 0xFE) { exit 0 } else { exit 1 }" >nul 2>&1
if errorlevel 1 exit /b 0
:: Create backup
set "BACKUP=%BASE_PATH%\whitelist_backup_%date:~-4,4%%date:~-7,2%%date:~-10,2%_%time:~0,2%%time:~3,2%%time:~6,2%.txt"
set "BACKUP=%BACKUP: =0%"
copy /y "%WHITELIST%" "%BACKUP%" >nul
:: Convert UTF-16 to UTF-8 without BOM
powershell -command "$content = Get-Content -Path '%WHITELIST%' -Encoding Unicode -Raw; $utf8NoBom = New-Object System.Text.UTF8Encoding $false; [System.IO.File]::WriteAllText('%WHITELIST%', $content, $utf8NoBom)"
