Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   replace string with spaces? (https://www.delphipraxis.net/203158-replace-string-spaces.html)

direktor 19. Jan 2020 17:44

AW: replace string with spaces?
 
Index.html file to test is included in the zip. I want change the website Title.

DieDolly 19. Jan 2020 17:54

AW: replace string with spaces?
 
It doesn't work because your did not read correctly what Dalai has written before.

direktor 20. Jan 2020 03:21

AW: replace string with spaces?
 
I think StringReplace doesn't work because HTML file is not in ANSI text but in UTF or Unicode format. I'll check. Yes I thought so. UTF-8. So what to do now?

direktor 20. Jan 2020 03:25

AW: replace string with spaces?
 
StringReplace will only work on ANSI files. So I need to use Stream Read to read file in UTF-8 format then what? Convert to ANSI or use some unicode string replace function that works with UTF-8?

Luckie 20. Jan 2020 03:32

AW: replace string with spaces?
 
Use XE8.

direktor 20. Jan 2020 03:34

AW: replace string with spaces?
 
DieDolly was using ANSI INI file. I have UTF-8 file. Here is one solution.

SS := TStringStream.Create('', TEncoding.UTF8);
SS.LoadFromFile(ParamStr1);

S := StringReplace(SS.DataString, 'Å', 'A', [rfReplaceAll]);

SS2 := TStringStream.Create(S, TEncoding.UTF8);
SS2.SaveToFile(ParamStr2);

SS2.Free;
SS.Free;

DieDolly 20. Jan 2020 06:52

AW: replace string with spaces?
 
Zitat:

DieDolly was using ANSI INI file. I have UTF-8 file. Here is one solution.
Have a look on your own XE8 code. You never assigned the result of StringReplace tro anything.

direktor 20. Jan 2020 11:25

AW: replace string with spaces?
 
Right. That was my mistake sorry. It works now.


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:12 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz