AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

replace string with spaces?

Ein Thema von direktor · begonnen am 19. Jan 2020 · letzter Beitrag vom 20. Jan 2020
Antwort Antwort
Seite 2 von 2     12   
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#11

AW: replace string with spaces?

  Alt 19. Jan 2020, 17:44
Index.html file to test is included in the zip. I want change the website Title.
  Mit Zitat antworten Zitat
DieDolly

Registriert seit: 22. Jun 2018
2.175 Beiträge
 
#12

AW: replace string with spaces?

  Alt 19. Jan 2020, 17:54
It doesn't work because your did not read correctly what Dalai has written before.
  Mit Zitat antworten Zitat
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#13

AW: replace string with spaces?

  Alt 20. Jan 2020, 03:21
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?
  Mit Zitat antworten Zitat
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#14

AW: replace string with spaces?

  Alt 20. Jan 2020, 03:25
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?
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#15

AW: replace string with spaces?

  Alt 20. Jan 2020, 03:32
Use XE8.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#16

AW: replace string with spaces?

  Alt 20. Jan 2020, 03:34
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;
  Mit Zitat antworten Zitat
DieDolly

Registriert seit: 22. Jun 2018
2.175 Beiträge
 
#17

AW: replace string with spaces?

  Alt 20. Jan 2020, 06:52
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.
  Mit Zitat antworten Zitat
direktor

Registriert seit: 5. Apr 2014
22 Beiträge
 
#18

AW: replace string with spaces?

  Alt 20. Jan 2020, 11:25
Right. That was my mistake sorry. It works now.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:04 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz