Recent

Author Topic: Input UTF8, output ANSI (Windows 7)  (Read 398 times)

keithfre

  • New Member
  • *
  • Posts: 25
Input UTF8, output ANSI (Windows 7)
« on: October 26, 2022, 06:18:49 pm »
My Windows Lazarus program reads a UTF8 file (TMX) and tries to output the contents as ANSI for another Windows (Delphi 3) program. In the latter I'm still seeing text including characters such as ….

StringReplace(s, '…' , '…'); etc. doesn't have any effect on the output strings.

I've tried the following on the stringlist loaded from the UTF8 file, but to no avail:
ws:=tmplist
  • ; // ws:widestring

s:=UTF8toAnsi(ws); //s:ansistring

I'd be grateful for any suggestions
-Keith Freeman

ASerge

  • Hero Member
  • *****
  • Posts: 2249
Re: Input UTF8, output ANSI (Windows 7)
« Reply #1 on: October 26, 2022, 07:12:08 pm »
My Windows Lazarus program reads a UTF8 file (TMX) and tries to output the contents as ANSI for another Windows (Delphi 3) program. In the latter I'm still seeing text including characters such as ….

I'd be grateful for any suggestions
LazUTF8.UTF8ToWinCP

keithfre

  • New Member
  • *
  • Posts: 25
Re: Input UTF8, output ANSI (Windows 7)
« Reply #2 on: October 26, 2022, 08:04:41 pm »
That works, fabulous!

Many thanks.
-Keith Freeman

 

TinyPortal © 2005-2018