[SOLVED] Multiple spaces being stripped when using FileStreamUTF8.Write lazarus / 16-Databases ---------------------------------------------------------------------- Gizmo · 2021-12-15 19:41 Hi all A user has rightly reported to me that multiple space characters get stripped when saving my grid content to HTML in the following scenario: Content of Grid : ABCDE.txt A BCDE.txt A  BCDE.txt A   BCDE.txt Content of HTML output : ABCDE.txt (correct) A BCDE.txt (correct) A BCDE.txt (wrong) A BCDE.txt (wrong) The line where this occurs is when I write the content of my DBGrid. I get the content like this: 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 MyString := DBGrid.DataSource.DataSet.Fields[1].AsString;  And then I write it to the HTML stream like this : 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 var  fs           : TFileStreamUTF8;begin  fs.Write(MyString[1], Length(MyString));end; What might causing the multiple spaces to be stripped? ---------------------------------------------------------------------- winni · 2021-12-15 19:47 Hi! That is due to HTML specification: Multiple spaces are reduced to one. If you want to get a protected space you have to use Code: HTML5  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   Winni Not readable in my browser: pale yellow on white   ---------------------------------------------------------------------- Gizmo · 2021-12-15 21:23 Of course! Spot on Winni. Thanks For others : https://developer.mozilla.org/en- US/docs/Web/API/Document_Object_Model/Whitespace