Unicode stdin is misread in server console of Windows version?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
x2605
Inserter
Inserter
Posts: 41
Joined: Fri Jul 31, 2020 4:08 pm
Contact:

Unicode stdin is misread in server console of Windows version?

Post by x2605 »

I don't know what's wrong with both windows cmd and powershell 5.1 input.
Factorio.exe running in headless mode looks like doesn't accept unicode(?) stdin from direct typing through cmd or powershell console.
Here are some output. Batch file is written in UTF8noBOM
echo text. 안녕 is written in batch file with UTF8 w/o BOM
0.002 2020-08-14 12:09:47; Factorio 0.18.47 (build 54412, win64, alpha)
0.002 Operating system: Windows 10 (version 2004)
0.003 Program arguments: ".\bin\x64\factorio.exe" "--port" "34300" "--start-server-load-scenario" "scenario안녕folder" "--map-gen-settings" ".\data\map-gen-settings.json" "--map-settings" ".\data\map-settings.json" "--server-settings" ".\data\server-settings.json"
0.003 Read data path: E:/Server/Factorio_0.18.45/data
0.003 Write data path: E:/Server/Factorio_0.18.45 [115381/202842MB]
0.003 Binaries path: E:/Server/Factorio_0.18.45/bin
0.011 System info: [CPU: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz, 4 cores, RAM: 4646/16341 MB, page: 5598/18773 MB, virtual: 4235/134217727 MB, extended virtual: 0 MB]
0.012 Running in headless mode
0.018 Loading mod core 0.0.0 (data.lua)
0.097 Loading mod base 0.18.47 (data.lua)
0.500 Loading mod base 0.18.47 (data-updates.lua)
0.702 Checksum for core: 2355680424
0.702 Checksum of base: 1020086456
0.906 Prototype list checksum: 844595475
0.955 Info PlayerData.cpp:68: Local player-data.json available, timestamp 1597374584
0.955 Info PlayerData.cpp:75: Cloud player-data.json unavailable
0.965 Factorio initialised
0.968 Info ServerSynchronizer.cpp:30: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0). 0.968 Info ServerMultiplayerManager.cpp:772: updateTick(4294967295) changing state from(Ready) to(PreparedToHostGame) 0.968 Info ServerMultiplayerManager.cpp:772: updateTick(4294967295) changing state from(PreparedToHostGame) to(CreatingGame)
1.746 Loading level.dat: 1103286 bytes.
1.747 Info Scenario.cpp:187: Map version 0.18.47-0
1.777 Checksum for script E:/Server/Factorio_0.18.45/temp/currently-playing/control.lua: 4181135456
1.809 Info ServerMultiplayerManager.cpp:358: OS does not support non-blocking saving. Forcing value to false.
1.809 Info UDPSocket.cpp:27: Opening socket at (IP ADDR:({0.0.0.0:34300}))
1.810 Hosting game at IP ADDR:({0.0.0.0:34300})
1.810 Info ServerMultiplayerManager.cpp:772: updateTick(0) changing state from(CreatingGame) to(InGame)
1.811 Info UDPSocket.cpp:39: Opening socket for broadcast
1.813 Info CommandLineMultiplayer.cpp:281: Maximum segment size = 100; minimum segment size = 25; maximum-segment-size peer count = 10; minimum-segment-size peer count = 20
test안녕123
2020-08-14 12:09:54 [CHAT] <server>: test123
I guess cmd writes plain UTF8 properly. See below.
I checked 1.txt written below and advanced text editor says it is exactly UTF8(no BOM)
Active code page: 65001

E:\>echo 안녕 > 1.txt

E:\>type 1.txt
안녕

E:\>
I could see factorio properly writes UTF8 as stdout if someone chat in non-ascii from game.
start /wait factorio.exe ...blahblah... > stdout.txt
in this case, stdout.txt contains proper UTF8 letters from in-game chat but broken letters from server console chat.

I can't understand why factorio misread stdin from cmd. Am I missed something?
I'm using Windows 10 version=2004 build=19041.450
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)

Post Reply

Return to “Technical Help”