Re: [fpc-pascal] converting to UTF8

2022-03-24 Thread Tomas Hajny via fpc-pascal
On 2022-03-24 20:47, Santi via fpc-pascal wrote: El 23/03/2022 a las 10:51, Mattias Gaertner via fpc-pascal escribió: FPC does not yet understand comments, What do you mean with "understand comments"? Mattias meant that comments were the only place where information about use of CP1252 was

Re: [fpc-pascal] converting to UTF8

2022-03-24 Thread Santi via fpc-pascal
El 23/03/2022 a las 10:51, Mattias Gaertner via fpc-pascal escribió: FPC does not yet understand comments, What do you mean with "understand comments"? so maybe it does not know this literal is cp1252. Add {$codepage cp1252} somewhere at the start of the unit. If this is part of a Lazarus ap

Re: [fpc-pascal] converting to UTF8

2022-03-23 Thread Mattias Gaertner via fpc-pascal
On Tue, 22 Mar 2022 04:47:50 -0400 cibersvaa--- via fpc-pascal wrote: > Lazarus 2.012 > FPC: 3.2.0 > SVN: 64642 > OS: Windows 10 Pro/win64 > > I'm reading from a file with character set win1252, I want to convert > it to utf8, but I can't. > > procedure TestString; > var >Original:string; >

Re: [fpc-pascal] converting to UTF8

2022-03-23 Thread LacaK via fpc-pascal
procedure TestString; var   Original:string;   Converted:string; begin   original:='ESPA'#209'A'; //ESPAÑA WIN1252   Converted:=ansiToUtf8(original);  // converts to 'ESPA'#239#191#189'A'  // converted Should be 'ESPA'#195#145'A' end; I've tried playing with strings types, string, rawstring,ans