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

Tomas Hajny XHajT03 at hajny.biz
Thu Sep 5 11:49:50 CEST 2019

On 2019-09-05 10:24, Tony Whyman wrote:
> A few points:
> 1. IMHO: This is currently a Windows problem where the console buffer
> is UCS2. Linux (and probably all other cases its UTF8 - to be
> verified).

No, the subject refers to text files, not to console. Obviously, console 
output has its caveats, but that's something else - the possibly added 
functionality of being able to read and write text files with UTF-16 
encoding using Read(Ln)/Write(Ln) does not imply that you might be able 
to change the console to whatever codepage value directly (this is not 
the case today either: you can perfectly write UTF-8 to a text file 
under GO32v2 if using the fpWideString manager, but the underlying 
communication is performed using the console encoding, not the text file 
encoding, and translation is needed on the fly).


More information about the fpc-pascal mailing list