473,386 Members | 1,764 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 ascii problem

JR
Hi,

I write a console program and some characters are not correct when I
rederect the output to a file

this are the textes that gives problems.

Dim c1 As String = " ?" '179¦

Dim c2 As String = " ?" '192+

Dim c3 As String = " ?" '195+

Dim c4 As String = "? " '196

the came out the file as: ² Ä

how can I solve this.

Jan
Jun 21 '07 #1
5 1252
Check Encoding class and conversions for specific code pages. Also, you need
to check CultureInfo.CurrentUICulture.

HTH
Alex

"JR" <x.*@x.xwrote in message
news:xU*********************@phobos.telenet-ops.be...
Hi,

I write a console program and some characters are not correct when I
rederect the output to a file

this are the textes that gives problems.

Dim c1 As String = " ?" '179¦

Dim c2 As String = " ?" '192+

Dim c3 As String = " ?" '195+

Dim c4 As String = "? " '196

the came out the file as: ² Ä

how can I solve this.

Jan

Jun 21 '07 #2
>I write a console program and some characters are not correct when I
>rederect the output to a file

this are the textes that gives problems.

Dim c1 As String = " ?" '179¦

Dim c2 As String = " ?" '192+

Dim c3 As String = " ?" '195+

Dim c4 As String = "? " '196

the came out the file as: ² Ä

Which program do you use to look at the file?
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jun 21 '07 #3
On 22 jun, 00:18, Mattias Sjögren <mattias.dont.want.s...@mvps.org>
wrote:
I write a console program and some characters are not correct when I
rederect the output to a file
this are the textes that gives problems.
Dim c1 As String = " ?" '179¦
Dim c2 As String = " ?" '192+
Dim c3 As String = " ?" '195+
Dim c4 As String = "? " '196
the came out the file as: ² Ä

Which program do you use to look at the file?

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.orghttp://www.msjogren.net/dotnet/|http://www.dotnetinterop.com
Please reply only to the newsgroup.- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
the good old notepad

Jun 25 '07 #4
On 21 jun, 22:16, "AlexS" <salexru200...@SPAMrogers.comPLEASEwrote:
Check Encoding class and conversions for specific code pages. Also, you need
to check CultureInfo.CurrentUICulture.

HTH
Alex

"JR" <x...@x.xwrote in message

news:xU*********************@phobos.telenet-ops.be...
Hi,
I write a console program and some characters are not correct when I
rederect the output to a file
this are the textes that gives problems.
Dim c1 As String = " ?" '179¦
Dim c2 As String = " ?" '192+
Dim c3 As String = " ?" '195+
Dim c4 As String = "? " '196
the came out the file as: ² Ä
how can I solve this.
Jan- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
Do you have some examples
Jan

Jun 25 '07 #5
For console
String.Format (IFormatProvider, String, Object[])


For file
StreamWriter (Stream, Encoding) Initializes a new instance of
the StreamWriter class for the specified stream, using the specified
encoding and the default buffer size.
Try Encoding.Convert (Encoding, Encoding, Byte[]) Converts an entire
byte array from one encoding to another.
Exact approach depends on your thread culture, windows culture and
file culture. You might have all three different.

Can you post your code demonstrating issue?

Replaces the format item in a specified String with the text
equivalent of the value of a corresponding Object instance in a specified
array. A specified parameter supplies culture-specific formatting
information.


<dr*******@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
On 21 jun, 22:16, "AlexS" <salexru200...@SPAMrogers.comPLEASEwrote:
Check Encoding class and conversions for specific code pages. Also, you
need
to check CultureInfo.CurrentUICulture.

HTH
Alex

"JR" <x...@x.xwrote in message

news:xU*********************@phobos.telenet-ops.be...
Hi,
I write a console program and some characters are not correct when I
rederect the output to a file
this are the textes that gives problems.
Dim c1 As String = " ?" '179¦
Dim c2 As String = " ?" '192+
Dim c3 As String = " ?" '195+
Dim c4 As String = "? " '196
the came out the file as: ² Ä
how can I solve this.
Jan- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
Do you have some examples
Jan
Jun 25 '07 #6

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

Similar topics

16
by: Chris Maloof | last post by:
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via...
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: 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...
3
by: Jerry | last post by:
I am having problem with Console.Read(), the Value I entered is not the value that store in my variable. public class Num { int num; Console.Write("Enter a number: "); num=Console.Read();...
5
by: Publicjoe | last post by:
I am working on a little app which uses colour in the console window. I have created a class to extend the console functionality but the ClearScreen method does not work correctly. I am enclosing a...
7
by: Robert | last post by:
Hello, I'm using Pythonwin and py2.3 (py2.4). I did not come clear with this: I want to use win32-fuctions like win32ui.MessageBox, listctrl.InsertItem ..... to get unicode strings on the...
8
by: Gaurav | last post by:
Hi All, I have written the 'c' code for specific purpose and tested it over many files and it is crashing in only one case. When I ran the same code in the debug mode within the VS against the...
2
by: nautonnier | last post by:
Hello, I have a C# app that spawns several processes each containing a console app written by another developer in C++. The console app was written first to be just like a console app: it...
2
by: =?Utf-8?B?S3VtYXI=?= | last post by:
I am using granados telnet client for connecting to the telnet and get the data from it. Every thing appears to be going smooth. But for some reason when I try to write the byte data to a string or...
2
by: Tenaious | last post by:
Hi, Sorry about such a ridicules question, but I have no clue what’s going on. I'm Using Visual Studio 08, programming in C++. I have a Serial Port created with: static...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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.