Have you checked that no other similar issue already exists?
[X] I have searched and not found similar issues.
A clear and concise description of what the bug is.
The following script fails to compile because it cannot find bd_Жmain.zc, even though it exists:
however, if that line is changed from:
#include "Z_Bdoom/bd_Жmain.zc"
to use the lower-case version of 'ж':
#include "Z_Bdoom/bd_жmain.zc"
it works fine, even through the file is actually named bd_Жmain.zc with the upper-case version of Ж.
The problem is that during the initial load, NormalizeFileName() is run on every file and converts the file name to lower case, which is stored in the FileInfo. This correctly uses tolower_normalize() to convert upper-case unicode strings to lower-case unicode strings. However, CheckNumForFullName() uses strnicmp() for string comparison, which doesn't work with unicode strings.
This bug applies to everything that uses stricmp() or strnicmp(); this would include FName lookups, etc.
An easy fix would be to just run tolower_normalize() first, but that allocates a string on the heap every time and suffer a performance hit. Also, I'm not sure if unicode names in ZScript and DECORATE files are actually officially supported.
GZDoom version
master
Which game are you running with GZDoom?
Doom 2
What Operating System are you using?
Mac OS
Please describe your specific OS version
macOS Sonoma
Relevant hardware info
No response
Have you checked that no other similar issue already exists?
A clear and concise description of what the bug is.
The following script fails to compile because it cannot find
bd_Жmain.zc
, even though it exists:however, if that line is changed from:
to use the lower-case version of 'ж':
it works fine, even through the file is actually named
bd_Жmain.zc
with the upper-case version ofЖ
.The problem is that during the initial load,
NormalizeFileName()
is run on every file and converts the file name to lower case, which is stored in theFileInfo
. This correctly usestolower_normalize()
to convert upper-case unicode strings to lower-case unicode strings. However,CheckNumForFullName()
usesstrnicmp()
for string comparison, which doesn't work with unicode strings.This bug applies to everything that uses
stricmp()
orstrnicmp()
; this would includeFName
lookups, etc.An easy fix would be to just run
tolower_normalize()
first, but that allocates a string on the heap every time and suffer a performance hit. Also, I'm not sure if unicode names in ZScript and DECORATE files are actually officially supported.Steps to reproduce the behaviour.
See above
Your configuration
Provide a Log
N/A