Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert UTF to ANSI?

Status
Not open for further replies.

selena1

Programmer
Apr 7, 2003
69
Hi!

I need a way to convert text file that was saved using UTF encoding to file that use ANSI encoding. File don't need to be modified.

I tried to use Notepad from Delphi, but after opening the file how to close Notepad with selected option for ANSI encoding. Is this even possible?

Is there any other way for this conversion?

Application need to work with directory full of files that need to be converted from UTF to ANSI.

Can anybody help me we this?


Thanks!

 
Have tried loading the file into a Delphi RichEdit box, setting PlainText to True. I've found this to be a very effective way of cleaning text in the past and just a couple of lines of code:

richedit1.lines.LoadFromFile('filename');
richedit1.lines.SaveToFile('filename');

I've also just notice the UFT8 to ANSI function, although I've never used it.

Hope this helps.
 
This solution with RichEdit box looks OK.

I don't know for UTF8 to ANSI function.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top