473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

console and characters

Hi everyone,

I'm having a problem with some Swedish characters.
I'm sending and reading from the command-line, cmd.exe, and I get the output alright when setting the CodePage to 850, Western European (DOS).

The problem is that if I send a string that contains a Swedish character it gets screwed up and cmd.exe can't understand what I mean.

I use this to browse my drives and if I try to cd a directory with a Swedish character in it I get "The system cannot find the path specified." as a response.

Does anyone have an idea on this?



Expand|Select|Wrap|Line Numbers
  1.  
  2. private Process proc;
  3. private ProcessStartInfo ps;
  4.  
  5. ps = new ProcessStartInfo();
  6. ps.CreateNoWindow = true;
  7. ps.FileName = "cmd.exe";
  8. ps.UseShellExecute = false;
  9. ps.RedirectStandardInput = true;
  10. ps.RedirectStandardOutput = true;
  11. ps.RedirectStandardError = true;
  12.  
  13. ps.StandardOutputEncoding = Encoding.GetEncoding(850);
  14.  
  15. proc = new Process();
  16. proc.StartInfo = ps;
  17. proc.Start();
  18.  
  19. proc.StandardInput.WriteLine( cmd );
  20. proc.StandardInput.WriteLine("exit");
  21.  
  22. string line  = proc.StandardOutput.ReadToEnd();
  23. string error = proc.StandardError.ReadToEnd();
  24.  
  25. proc.Close();
  26.  
[/IMG]
May 28 '07 #1
0 778

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Gregor | last post by:
I am trying to print some special characters, but they come out as different characters in the Python console. If I have a script like this: # -*- coding: latin_1 -*- print "Mädchen" print...
1
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? ...
1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
2
by: glean | last post by:
My console in WinXP is using Lucida Console for the font. My problem is, I can go to character map and select a string of special characters such as the following: ®¾Öþ¬«§¯ I can paste them into...
2
by: Rick | last post by:
I have a Windows exe app that runs with or without user intervention. When it is running w/o user intervention the program is called from a DOS windows, it's main form is set to visible=false and...
5
by: kevin | last post by:
using VS 2003 I have a console app and writing to the console looks ugly as the line wraps at exactly 80 characters. Short of counting every character, is there an easier way to format my...
2
by: PHead | last post by:
Is there any way to stop the console from scrolling? What I mean isnt to not scroll at all, its that I want to get rid of the buffer. When a new line is created, I want row 0 to go away...
1
by: Méta-MCI | last post by:
Good evening! I installed the Console of EFFBOT (http://effbot.org/downloads/#console). It functions well. It's a very fun/friendly tool. Except a detail: when I send (by console.write()) more...
6
by: Shankar | last post by:
Hi, I am not able to print the Unicode character on the console. I tried with these API's 1) wprintf() displays ??????? 2) _cwprintf() displays
4
by: =?Utf-8?B?UGFvbG8=?= | last post by:
Is there a way of accessing the various graphics characters to facilitate drawing on the screen in console apps. I don't want to use the '-' (hyphen) character - I thoughtthere were some 'graphics'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.