Broken char through Format() with ThousandSeparator = NBSP lazarus / 3-General ---------------------------------------------------------------------- anse · 2025-06-11 09:25 I have some users with ru-RU locale, which has ThousandSeparator = #160 (no-break-space, looks like a space but allows no line break). Formatting numbers in their locale shows a broken ThousandSeparator, see attached images. First one is done on a ru-RU Linux system, second one on my own de-DE Windows where I testwise set that nbsp char: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i DefaultFormatSettings.ThousandSeparator:= chr(160);Both are generated through: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Format('%.0n', [aValue + 0.0]) Confusing to me is that nbsp is even in the ASCII and LATIN1 charset. Is it known that Format cannot handle certain diacritical characters? There's a 9 year old post saying this is not supported by FPC: https:/ /forum.lazarus.freepascal.org/index.php/topic,32159.msg207284.html#msg 207284 ---------------------------------------------------------------------- paweld · 2025-06-11 09:47 Lazarus treats strings as UTF-8 so you need to convert formatted value to UTF8: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  LazUTF8; var  fs: TFormatSettings;begin  fs.ThousandSeparator := #160;  Caption := WinCPToUTF8(Format('%.0n', [123456.0], fs)); //or CP1251ToUTF8 from LConvEncoding unitend; ---------------------------------------------------------------------- anse · 2025-06-11 11:52 Thanks a lot @paweld. LazUTF8.WinCPToUTF8 showed up another (broken) character instead of the question mark. But it looks like LConvEncoding.CP1251ToUTF8 is doing the right thing - at least on Windows, but I guess the Linux version does the same. ---------------------------------------------------------------------- paweld · 2025-06-11 13:30 Quote from: anse on June 11, 2025, 01:52:24 pmLazUTF8.WinCPToUTF8 showed up another (broken) character instead of the question mark. probably because the Windows code page is not Latin1