Re: [fpc-pascal] Read lines into UnicodeString variable from UCS2 (UTF-16) encoded text file

2019-09-16 Thread Tomas Hajny

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


Re: [fpc-pascal] Read lines into UnicodeString variable from UCS2 (UTF-16) encoded text file

2019-09-16 Thread LacaK



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,


unfortunately this is also my case for now



your potential contribution would be appreciated.


maybe sometime later I will take the time to look at it

L.


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