Yes, I know, there are many already existing solutions for writing a CSV file in Delphi. And some are probably better than mine (for general purpose usage), but those I looked at had too many shortcomings for my particular use case, so I wrote my own. (There might also have been some not invented here syndrome involved.)
Anyway: It’s now in my dzlib as u_dzCsvWriter and there are also unit tests for it.
Note that I have tested it only with Delphi 2007 so far (because I needed it for Delphi 2007). There might be Unicode related bugs that only surface in later versions.