Re: [fpc-pascal] Convert codepages back to UTF8

2019-05-27 Thread Martok
Am 27.05.2019 um 14:30 schrieb Sven Barth via fpc-pascal:
> Alexey Tor.  > schrieb am Mo., 27. Mai 2019, 13:15:
> 
> LazUtils.LConvEncoding can convert utf8 to codepage (not many codepages)
> and vice versa.
> 
> FPC 3 can convert utf8 to codepage - via SetCodePage(s, codepage, true).
> But how can FPC convert back - codepage to utf8? Does such way exist?
> 
> 
> Use CP_UTF8 as code page for SetCodePage or assign the string to a UTF8String
> variable. 

Although be advised that if your SystemCodePage is not a Unicode codepage, there
will be data loss due to (sometimes unexpected) internal conversions, regardless
of the current dynamic string code page.


-- 
Regards,
Martok


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

Re: [fpc-pascal] Convert codepages back to UTF8

2019-05-27 Thread Sven Barth via fpc-pascal
Alexey Tor.  schrieb am Mo., 27. Mai 2019, 13:15:

> LazUtils.LConvEncoding can convert utf8 to codepage (not many codepages)
> and vice versa.
>
> FPC 3 can convert utf8 to codepage - via SetCodePage(s, codepage, true).
> But how can FPC convert back - codepage to utf8? Does such way exist?
>

Use CP_UTF8 as code page for SetCodePage or assign the string to a
UTF8String variable.

Regards,
Sven

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

[fpc-pascal] Convert codepages back to UTF8

2019-05-27 Thread Alexey Tor.
LazUtils.LConvEncoding can convert utf8 to codepage (not many codepages) 
and vice versa.


FPC 3 can convert utf8 to codepage - via SetCodePage(s, codepage, true). 
But how can FPC convert back - codepage to utf8? Does such way exist?


--
Regards,
Alexey

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