The application which created it uses ISO-8859-1 for its encoding.
what should it mean, specifically ?
in Delphi/Windows it would mean result of `GetThreadLocale` for the current thread, which by default is the same as all other threads and with Windows user interface default language setup.
in Linux there was a whole bunch of LOCALE_xxx and LANG_xx environment variables. I even used to know few of them :-)
On top of that Delphi and FPC have overriiding in their RTL, SetMultiByteConversionCodePage - but Dephi does not use it, while Lazarus does.
https://wiki.freepascal.org/FPC_Unicode_support#DefaultSystemCodePageThis has THREE different defaults even, System, FileSystem and RTLFileSystem Ж8-[...]
Maybe i just won't need it. Hopefully.
Perhaps just DLL/SO function names can be safely patched in GTK2 sources, for all the platforms at once.
I eared that it can get to the situation, when for different platforms different names would be needed.
---------
An application creates a file named "Tést". The application which created it uses ISO-8859-1 for its encoding.
For what i remember fomr Linux 2.4/2.6 times, the filesystem would normally convert that name to it's internall format. And the charset used to communicate filenames to Linux kernel is normally specified in mount command options. Some filesystems would always use UTF-8 or UTF-16 on-disk, others would let mount charset be immediately used.
Then there is another seam, betwene Linux and application. Not sure which charset could be used there and how it was decided. Anyway, we do not control it.
Then we have a seam between GTK and application code. This is where we get control and thus responsibility...
And i can not choose between two ideas. Frankly, maybe it is not relevant in practice.
I also was double ocnfused, because functions with and without _utf8 suffics could behave differently (then that suffix would have marked this difference in behavior, like windows API is having most functions as a pair of xxxxA and xxxxW functions.
I could imagine, that GTK functions would return/consume filenames in UTF-8 regardless of what locale/charset is set for the application code and UI (even if app's charset is not UTF8).
I could imagine that GTK functions would return/consume filenames in some vagule OS-selected charset regardless of app's own internal charset (even if it would be UTF-8 while OS'es one is pre-Unicode).
if you get a file name from the file system - for example with readdir() - and you want to display the file name to the user with GTK, you will need to convert it into UTF-8.
Frankly, i would have expecteed GTK functions to do it transparently, especially if they have *_utf8 suffix.
i GTK-providd functions can do proper transcoding - then GTK managd ot get all information required. Then it could do transcode on their own.
What i was fearing is that mere changing function name from old to *_utf8 would suddenly change behavior and break some apps. And i still do, regardless the "#define" in the Gtk docs. I don't feel the whole picture and this lefts me wary.