How to programatically default the encoding of my "Notepad" into ANSI in c#

J

jj

How do I programatically default the encoding of my "Notepad" into ANSI.
My application uses notepad to save some text. Some of the client computers
have UTF as the default encoding in their notepad. This adds some
characters in my text and creates problems later on managing it.

So is there a way to create a text file in notepad with ANSI encoding
always?

Thanks
John
 
J

John M Deal

If all you are trying to do is give a notepad like experience to the
user, I'd recommend not shelling out to notepad at all; instead add a
form to your application that has a multi-line text box on it an manage
the load and save of the file from there. It really shouldn't take too
terribly long to replicate notepad's functionality and you'll be able to
control the encoding without fear of the user messing with it (save as
and all that). Aside from that I have no idea if notepad has a
parameter that will allow you to force an encoding type.

Have A Better One!

John M Deal, MCP
Necessity Software
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top