firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Resolves: tdf#125284 config entries not substituted under Turkish locale

Open caolanm opened this issue 5 years ago • 6 comments

https://bugs.documentfoundation.org/show_bug.cgi?id=125284

This leads to the inability of LibreOffice to create embedded firebird databases under a Turkish locale.

strcasecmp is used with LC_CTYPE honoured, and...

"These functions shall behave as if the strings had been converted to lowercase and then a byte comparison performed".

Turkish has the infamous problem that the lowercase of I is the dotless ı not i.

so strcasecmp("i", "I") != 0 means dir_FOO doesn't caseless match DIR_FOO

firebird/databases.conf contains $(dir_sampleDb) and the string it's compared to is DIR_SAMPLEDB so a simple fix is to changed DIR_SAMPLEDB to dir_sampledb and the defalt config will then substitute fine.

caolanm avatar Aug 23 '19 16:08 caolanm

That fix just hides a problem, not fixes it. Macro in conf file should be case-insensitive, i.e. one can type in a databases.conf: $(DIR_SAMPLEDB), $(dir_sampledb) or even $(DiR_sAmPlEdB) and that all should work.

AlexPeshkoff avatar Aug 26 '19 10:08 AlexPeshkoff

@AlexPeshkoff The problem is that uppercase/lowercase (like sort order) depends on the locale even for ASCII.

The lowercase of DIR_SAMPLEDB might be dir_sampledb or dır_sampledb (dotless ı) depending on the locale.

AdrianBunk avatar Jan 15 '24 00:01 AdrianBunk

ASCII has no "dotless i" character.

aafemt avatar Jan 15 '24 10:01 aafemt

ASCII has no "dotless i" character.

But the large I in ASCII might be lowercased to dotless ı depending on the locale.

This is similar to e.g. wrongly assuming that z would not be sorted between s and t - whether that's true depends on the locale. English has z at the end of the alphabet but that's not true for every language.

AdrianBunk avatar Jan 15 '24 11:01 AdrianBunk

ASCII is a very specific American charset. Only American locale rules can be applied to it.

aafemt avatar Jan 15 '24 11:01 aafemt

ASCII is a very specific American charset. Only American locale rules can be applied to it.

To make you nitpicker happy, let me correct myself:

The problem is that uppercase/lowercase (like sort order) depends on the locale even for the 26 characters that are also in ASCII.

@aafemt Is this a correct statement, so that you can now fix the bug?

AdrianBunk avatar Jan 15 '24 11:01 AdrianBunk