unit clocale creates invalid characters on Russian Linux
Original Reporter info from Mantis: Mattias @lazidealist
-
Reporter name: Mattias Gaertner
Original Reporter info from Mantis: Mattias @lazidealist
- Reporter name: Mattias Gaertner
Description:
unit clocale sets FormatSettings by asking nl_langinfo.
The "char" variables are set by using the first byte of the locale strings.
On Linux the thousand separator for Russian ru_RU.UTF-8 (LC_NUMERIC=ru_RU.utf8) is #C2
A0 - a two byte in UTF-8. This results in the invalid character #$C2.
The attached patch checks for non ASCII character and CP_UTF8, so that the default is used.
Steps to reproduce:
export LC_NUMERIC=ru_RU.utf8
{$mode ObjFPC}
uses Classes, SysUtils, clocale;
begin
writeln(ThousandSeparator);
end;
Mantis conversion info:
- Mantis ID: 27099
- Version: 2.7.1