472,362 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,362 software developers and data experts.

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

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
Nov 16 '05 #1
1 2829
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

jj wrote:
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

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Trevor Fairchild | last post by:
I need to open an html document in notepad and save it using ANSI encoding. I can do this manually using notepad and File/Save-as, but is there a way to do this from VB. I can open a specific...
2
by: Martín Marconcini | last post by:
Hello there, I'm writting (or trying to) a Console Application in C#. I has to be console. I remember back in the old days of Cobol (Unisys), Clipper and even Basic, I used to use a program...
2
by: Ziver MALHASOGLU | last post by:
Hi, I produce a text file using my windows application written with c#. -- System.Text.Encoding encOutput=null; encOutput=System.Text.Encoding.UTF8; StreamWriter sw=new...
4
by: Nick | last post by:
Hi, I am trying to output a string of chinese characters as a text file. When I open a file for writing from VB, the file is automatically set to UTF-8 encoding (can tell by opening the file...
2
by: Arne | last post by:
Hi, I would like to save a textfile in exactly the same format, as if I use Notepad and choose the encoding style to ANSI. How can I accomplish this in vb.net (I'm retrieving the input via my...
11
by: LucaJonny | last post by:
Hi, I've got a problem using StreamReader in VB.NET. I try to read a txt file that contains extended characters and theese are removed from the line that is being read. I've read a lot of...
4
by: liam_weston | last post by:
I have 2 supposedly identical Windows 2000 web servers each with IIS5. Both have the ASPCODEPAGE set to 65001 (utf-8) in the metabase. The first server has been running pages like the one below...
1
by: James | last post by:
this is a console program to convert ANSI to UTF8 format. Although in notepad i open the source file (which is ansi), and after running the program below, and re-open in notepad (it shows utf8...
4
by: =?Utf-8?B?R2lubw==?= | last post by:
I have written an application which uses a streamwriter to create which is exported to a third party system. The third party system does not appear to process the files in its original format. I...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.