https://bugs.documentfoundation.org/show_bug.cgi?id=99589
Bug ID: 99589
Summary: tolower / toupper - dangerous to Turks ...
Product: LibreOffice
Version: 5.1.0.1 rc
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
We have had build failures when compiling in the Turkish locale - ie.
export LANG=tr_TR.UTF-8
This is because in this locale - toupper(i) is != 'I' and toupper(ı) == 'I' cf.
wikipedia: https://en.wikipedia.org/wiki/Turkish_alphabet#Letters
bug#99587 - is a first cut at fixing one instance of this but - I think we can
conclude on this basis that any use of 'toupper' or 'tolower' in the code is a
bug. Instead we should use our own ASCII comparison functions here - ideally
using the Ascii variants in sal/ OString / OUString which cope with this.
This sort of thing looks plausibly safe in comparison - albeit ugly:
char easytolower( char in )
{
if( in<='Z' && in>='A' )
return in-('Z'-'z');
return in;
}
$ git grep toupper
$ git grep tolower
Thanks ! =)
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs