william
william

Reputation:

search and replace inside files usind Delphi language

I want to make a small app with Delphi to search inside files for a specific word and change it then save the file

It should support ansi and utf-8, how I should do that ?

thanks

Upvotes: 0

Views: 1313

Answers (1)

gabr
gabr

Reputation: 26850

If this is Delphi 2007 or older, you should probably use my GpTextFile unit (which also works in Delphi 2009 and 2010).

In D2009+ you can use TEncoding converters to achieve simillar effect. See these StackOverflow topics for more information:

Open an ANSI file and Save a a Unicode file using Delphi

How can a text file be converted from ANSI to UTF-8 with Delphi 7?

Upvotes: 1

Related Questions