On 2019-09-16 08:29, LacaK wrote:

Hi Laco,

 .
 .
Thank you Tomas.

My comment per function names: use pattern SetText.../GetText...
So for inspiration:
- GetTextBOM or ReadBOM(var T: Text; SetCodePage:boolean=True):Word,
  (parameter SetCodePage should specify if SetTextCodePage will be
called automatically if desired). Retunr value will be CP_NONE (no
BOM) or CP_UTF8, CP_UTF16,...
- SetTextBOM or WriteBOM(var T: Text; CodePage: Word)
  (writtes BOM corresponding to given CodePage and will call
SetTextCodePage). Boolean BOM parameter is IMO not needed as call to
this function signals, that user wants write BOM else user will call
SetTextCodePage() only

Yes, GetTextBOM/SetTextBOM as described above make sense, good idea.

Just to be clear - I don't have capacity to work on the implementation myself, your potential contribution would be appreciated. I'm ready to review and hopefully incorporate your implementation to trunk.

Tomas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to